diff --git a/Microsoft.ML.sln b/Microsoft.ML.sln index cc03c5583c..e52f9d2014 100644 --- a/Microsoft.ML.sln +++ b/Microsoft.ML.sln @@ -141,6 +141,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML", "src\Microso EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Mkl.Redist", "src\Microsoft.ML.Mkl.Redist\Microsoft.ML.Mkl.Redist.csproj", "{4584326B-C5B3-4CAE-B98A-34C5F5AA16F3}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Analysis", "src\Microsoft.Data.Analysis\Microsoft.Data.Analysis.csproj", "{84150C22-0627-4A11-81C9-F214762855EA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Analysis.Interactive", "src\Microsoft.Data.Analysis.Interactive\Microsoft.Data.Analysis.Interactive.csproj", "{D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Analysis.Tests", "test\Microsoft.Data.Analysis.Tests\Microsoft.Data.Analysis.Tests.csproj", "{0B765344-11A4-4738-9759-5060599DC134}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Data.Analysis.Interactive.Tests", "test\Microsoft.Data.Analysis.Interactive.Tests\Microsoft.Data.Analysis.Interactive.Tests.csproj", "{8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1680,6 +1688,102 @@ Global {4584326B-C5B3-4CAE-B98A-34C5F5AA16F3}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU {4584326B-C5B3-4CAE-B98A-34C5F5AA16F3}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU {4584326B-C5B3-4CAE-B98A-34C5F5AA16F3}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug|x64.ActiveCfg = Debug|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug|x64.Build.0 = Debug|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netcoreapp3_1|Any CPU.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netcoreapp3_1|Any CPU.Build.0 = Debug-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netcoreapp3_1|x64.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netcoreapp3_1|x64.Build.0 = Debug-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release|Any CPU.Build.0 = Release|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release|x64.ActiveCfg = Release|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release|x64.Build.0 = Release|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netcoreapp3_1|Any CPU.ActiveCfg = Release-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netcoreapp3_1|Any CPU.Build.0 = Release-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netcoreapp3_1|x64.ActiveCfg = Release-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netcoreapp3_1|x64.Build.0 = Release-netcoreapp3_1|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU + {84150C22-0627-4A11-81C9-F214762855EA}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug|x64.ActiveCfg = Debug|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug|x64.Build.0 = Debug|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netcoreapp3_1|Any CPU.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netcoreapp3_1|Any CPU.Build.0 = Debug-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netcoreapp3_1|x64.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netcoreapp3_1|x64.Build.0 = Debug-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release|Any CPU.Build.0 = Release|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release|x64.ActiveCfg = Release|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release|x64.Build.0 = Release|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netcoreapp3_1|Any CPU.ActiveCfg = Release-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netcoreapp3_1|Any CPU.Build.0 = Release-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netcoreapp3_1|x64.ActiveCfg = Release-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netcoreapp3_1|x64.Build.0 = Release-netcoreapp3_1|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug|x64.ActiveCfg = Debug|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug|x64.Build.0 = Debug|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netcoreapp3_1|Any CPU.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netcoreapp3_1|Any CPU.Build.0 = Debug-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netcoreapp3_1|x64.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netcoreapp3_1|x64.Build.0 = Debug-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release|Any CPU.Build.0 = Release|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release|x64.ActiveCfg = Release|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release|x64.Build.0 = Release|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netcoreapp3_1|Any CPU.ActiveCfg = Release-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netcoreapp3_1|Any CPU.Build.0 = Release-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netcoreapp3_1|x64.ActiveCfg = Release-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netcoreapp3_1|x64.Build.0 = Release-netcoreapp3_1|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU + {0B765344-11A4-4738-9759-5060599DC134}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug|x64.ActiveCfg = Debug|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug|x64.Build.0 = Debug|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netcoreapp3_1|Any CPU.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netcoreapp3_1|Any CPU.Build.0 = Debug-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netcoreapp3_1|x64.ActiveCfg = Debug-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netcoreapp3_1|x64.Build.0 = Debug-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netfx|Any CPU.ActiveCfg = Debug-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netfx|Any CPU.Build.0 = Debug-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netfx|x64.ActiveCfg = Debug-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Debug-netfx|x64.Build.0 = Debug-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release|Any CPU.Build.0 = Release|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release|x64.ActiveCfg = Release|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release|x64.Build.0 = Release|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netcoreapp3_1|Any CPU.ActiveCfg = Release-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netcoreapp3_1|Any CPU.Build.0 = Release-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netcoreapp3_1|x64.ActiveCfg = Release-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netcoreapp3_1|x64.Build.0 = Release-netcoreapp3_1|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netfx|Any CPU.ActiveCfg = Release-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netfx|Any CPU.Build.0 = Release-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netfx|x64.ActiveCfg = Release-netfx|Any CPU + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25}.Release-netfx|x64.Build.0 = Release-netfx|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1749,6 +1853,10 @@ Global {C8DB58DC-6434-4431-A81F-263D86E2A5F3} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4} {6CF88209-69DB-4B36-9604-3ECD9F163E96} = {09EADF06-BE25-4228-AB53-95AE3E15B530} {4584326B-C5B3-4CAE-B98A-34C5F5AA16F3} = {09EADF06-BE25-4228-AB53-95AE3E15B530} + {84150C22-0627-4A11-81C9-F214762855EA} = {09EADF06-BE25-4228-AB53-95AE3E15B530} + {D9FDD2D5-BFFC-4A4D-8589-7F63AA3EA923} = {09EADF06-BE25-4228-AB53-95AE3E15B530} + {0B765344-11A4-4738-9759-5060599DC134} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4} + {8AFB8CC3-DA0B-4364-BFB3-296A7C54CC25} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {41165AF1-35BB-4832-A189-73060F82B01D} diff --git a/NuGet.config b/NuGet.config index 5712c11fff..231d0f8008 100644 --- a/NuGet.config +++ b/NuGet.config @@ -11,7 +11,7 @@ - + diff --git a/eng/Versions.props b/eng/Versions.props index 353e9fecb6..2e24673209 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -32,8 +32,11 @@ 2.3.1 2 0.20.1 - 3.3.1 + 1.0.0-beta.20410.1 + 1.0.0-beta.20410.1 + 2.0.0 + 4.3.0 4.5.0 1.2.0 diff --git a/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs b/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs new file mode 100644 index 0000000000..595c71e5a6 --- /dev/null +++ b/src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs @@ -0,0 +1,155 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Html; +using Microsoft.DotNet.Interactive; +using Microsoft.DotNet.Interactive.Formatting; +using static Microsoft.DotNet.Interactive.Formatting.PocketViewTags; + +namespace Microsoft.Data.Analysis.Interactive +{ + public class DataFrameKernelExtension : IKernelExtension + { + public Task OnLoadAsync(Kernel kernel) + { + RegisterDataFrame(); + + return Task.CompletedTask; + } + + public static void RegisterDataFrame() + { + Formatter.Register((df, writer) => + { + const int MAX = 10000; + const int SIZE = 10; + + var uniqueId = DateTime.Now.Ticks; + + var header = new List + { + th(i("index")) + }; + header.AddRange(df.Columns.Select(c => (IHtmlContent)th(c.Name))); + + if (df.Rows.Count > SIZE) + { + var maxMessage = df.Rows.Count > MAX ? $" (showing a max of {MAX} rows)" : string.Empty; + var title = h3[style: "text-align: center;"]($"DataFrame - {df.Rows.Count} rows {maxMessage}"); + + // table body + var maxRows = Math.Min(MAX, df.Rows.Count); + var rows = new List>(); + for (var index = 0; index < maxRows; index++) + { + var cells = new List + { + td(i((index))) + }; + foreach (var obj in df.Rows[index]) + { + cells.Add(td(obj)); + } + rows.Add(cells); + } + + //navigator + var footer = new List(); + BuildHideRowsScript(uniqueId); + + var paginateScriptFirst = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, 0) + BuildPageScript(uniqueId, SIZE); + footer.Add(button[style: "margin: 2px;", onclick: paginateScriptFirst]("⏮")); + + var paginateScriptPrevTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -10, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + footer.Add(button[style: "margin: 2px;", onclick: paginateScriptPrevTen]("⏪")); + + var paginateScriptPrev = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -1, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + footer.Add(button[style: "margin: 2px;", onclick: paginateScriptPrev]("◀️")); + + footer.Add(b[style: "margin: 2px;"]("Page")); + footer.Add(b[id: $"page_{uniqueId}", style: "margin: 2px;"]("1")); + + var paginateScriptNext = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 1, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + footer.Add(button[style: "margin: 2px;", onclick: paginateScriptNext]("▶️")); + + var paginateScriptNextTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 10, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + footer.Add(button[style: "margin: 2px;", onclick: paginateScriptNextTen]("⏩")); + + var paginateScriptLast = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE); + footer.Add(button[style: "margin: 2px;", onclick: paginateScriptLast]("⏭️")); + + //table + var t = table[id: $"table_{uniqueId}"]( + caption(title), + thead(tr(header)), + tbody(rows.Select(r => tr[style: "display: none"](r))), + tfoot(tr(td[colspan: df.Columns.Count + 1, style: "text-align: center;"](footer))) + ); + writer.Write(t); + + //show first page + writer.Write($""); + } + else + { + var rows = new List>(); + for (var index = 0; index < df.Rows.Count; index++) + { + var cells = new List + { + td(i((index))) + }; + foreach (var obj in df.Rows[index]) + { + cells.Add(td(obj)); + } + rows.Add(cells); + } + + //table + var t = table[id: $"table_{uniqueId}"]( + thead(tr(header)), + tbody(rows.Select(r => tr(r))) + ); + writer.Write(t); + } + }, "text/html"); + } + + private static string BuildHideRowsScript(long uniqueId) + { + var script = $"var allRows = document.querySelectorAll('#table_{uniqueId} tbody tr:nth-child(n)'); "; + script += "for (let i = 0; i < allRows.length; i++) { allRows[i].style.display='none'; } "; + return script; + } + + private static string BuildPageScript(long uniqueId, int size) + { + var script = $"var page = parseInt(document.querySelector('#page_{uniqueId}').innerHTML) - 1; "; + script += $"var pageRows = document.querySelectorAll(`#table_{uniqueId} tbody tr:nth-child(n + ${{page * {size} + 1 }})`); "; + script += $"for (let j = 0; j < {size}; j++) {{ pageRows[j].style.display='table-row'; }} "; + return script; + } + + private static string GotoPageIndex(long uniqueId, long page) + { + var script = $"document.querySelector('#page_{uniqueId}').innerHTML = {page + 1}; "; + return script; + } + + private static string UpdatePageIndex(long uniqueId, int step, long maxPage) + { + var script = $"var page = parseInt(document.querySelector('#page_{uniqueId}').innerHTML) - 1; "; + script += $"page = parseInt(page) + parseInt({step}); "; + script += $"page = page < 0 ? 0 : page; "; + script += $"page = page > {maxPage} ? {maxPage} : page; "; + script += $"document.querySelector('#page_{uniqueId}').innerHTML = page + 1; "; + return script; + } + } +} diff --git a/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj b/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj new file mode 100644 index 0000000000..3167c983dc --- /dev/null +++ b/src/Microsoft.Data.Analysis.Interactive/Microsoft.Data.Analysis.Interactive.csproj @@ -0,0 +1,18 @@ + + + + netcoreapp3.1 + false + $(NoWarn);MSML_ParameterLocalVarName;SA1028 + + + + + + + + + + + + diff --git a/src/Microsoft.Data.Analysis/ArrowStringDataFrameColumn.cs b/src/Microsoft.Data.Analysis/ArrowStringDataFrameColumn.cs new file mode 100644 index 0000000000..a80e85c173 --- /dev/null +++ b/src/Microsoft.Data.Analysis/ArrowStringDataFrameColumn.cs @@ -0,0 +1,656 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; +using Apache.Arrow; +using Apache.Arrow.Types; +using Microsoft.ML; +using Microsoft.ML.Data; + +namespace Microsoft.Data.Analysis +{ + /// + /// An immutable column to hold Arrow style strings + /// + public partial class ArrowStringDataFrameColumn : DataFrameColumn, IEnumerable + { + private IList> _dataBuffers; + private IList> _offsetsBuffers; + private IList> _nullBitMapBuffers; + + /// + /// Constructs an empty with the given . + /// + /// The name of the column. + public ArrowStringDataFrameColumn(string name) : base(name, 0, typeof(string)) + { + _dataBuffers = new List>(); + _offsetsBuffers = new List>(); + _nullBitMapBuffers = new List>(); + } + + /// + /// Constructs an with the given , and . The , and are the contents of the column in the Arrow format. + /// + /// The name of the column. + /// The Arrow formatted string values in this column. + /// The Arrow formatted offets in this column. + /// The Arrow formatted null bits in this column. + /// The length of the column. + /// The number of values in this column. + public ArrowStringDataFrameColumn(string name, ReadOnlyMemory values, ReadOnlyMemory offsets, ReadOnlyMemory nullBits, int length, int nullCount) : base(name, length, typeof(string)) + { + ReadOnlyDataFrameBuffer dataBuffer = new ReadOnlyDataFrameBuffer(values, values.Length); + ReadOnlyDataFrameBuffer offsetBuffer = new ReadOnlyDataFrameBuffer(offsets, length + 1); + ReadOnlyDataFrameBuffer nullBitMapBuffer = new ReadOnlyDataFrameBuffer(nullBits, nullBits.Length); + + if (length + 1 != offsetBuffer.Length) + throw new ArgumentException(nameof(offsetBuffer)); + + _dataBuffers = new List>(); + _offsetsBuffers = new List>(); + _nullBitMapBuffers = new List>(); + + _dataBuffers.Add(dataBuffer); + _offsetsBuffers.Add(offsetBuffer); + _nullBitMapBuffers.Add(nullBitMapBuffer); + + _nullCount = nullCount; + + } + + private long _nullCount; + + /// + public override long NullCount => _nullCount; + + /// + /// Indicates if the value at this is . + /// + /// The index to look up. + /// A boolean value indicating the validity at this . + public bool IsValid(long index) => NullCount == 0 || GetValidityBit(index); + + private bool GetValidityBit(long index) + { + if ((ulong)index > (ulong)Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + // First find the right bitMapBuffer + int bitMapIndex = GetBufferIndexContainingRowIndex(index, out int indexInBuffer); + Debug.Assert(_nullBitMapBuffers.Count > bitMapIndex); + ReadOnlyDataFrameBuffer bitMapBuffer = _nullBitMapBuffers[bitMapIndex]; + int bitMapBufferIndex = (int)((uint)index / 8); + Debug.Assert(bitMapBuffer.Length > bitMapBufferIndex); + byte curBitMap = bitMapBuffer[bitMapBufferIndex]; + return ((curBitMap >> (indexInBuffer & 7)) & 1) != 0; + } + + private void SetValidityBit(long index, bool value) + { + if ((ulong)index > (ulong)Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + // First find the right bitMapBuffer + int bitMapIndex = GetBufferIndexContainingRowIndex(index, out int indexInBuffer); + Debug.Assert(_nullBitMapBuffers.Count > bitMapIndex); + DataFrameBuffer bitMapBuffer = (DataFrameBuffer)_nullBitMapBuffers[bitMapIndex]; + + // Set the bit + int bitMapBufferIndex = (int)((uint)indexInBuffer / 8); + Debug.Assert(bitMapBuffer.Length >= bitMapBufferIndex); + if (bitMapBuffer.Length == bitMapBufferIndex) + bitMapBuffer.Append(0); + byte curBitMap = bitMapBuffer[bitMapBufferIndex]; + byte newBitMap; + if (value) + { + newBitMap = (byte)(curBitMap | (byte)(1 << (indexInBuffer & 7))); //bit hack for index % 8 + if (((curBitMap >> (indexInBuffer & 7)) & 1) == 0 && indexInBuffer < Length - 1 && NullCount > 0) + { + // Old value was null. + _nullCount--; + } + } + else + { + if (((curBitMap >> (indexInBuffer & 7)) & 1) == 1 && indexInBuffer < Length) + { + // old value was NOT null and new value is null + _nullCount++; + } + else if (indexInBuffer == Length - 1) + { + // New entry from an append + _nullCount++; + } + newBitMap = (byte)(curBitMap & (byte)~(1 << (int)((uint)indexInBuffer & 7))); + } + bitMapBuffer[bitMapBufferIndex] = newBitMap; + } + + /// + /// Returns an enumeration of immutable buffers representing the underlying values in the Apache Arrow format + /// + /// values are encoded in the buffers returned by GetReadOnlyNullBitmapBuffers in the Apache Arrow format + /// The offsets buffers returned by GetReadOnlyOffsetBuffers can be used to delineate each value + /// An enumeration of whose elements are the raw data buffers for the UTF8 string values. + public IEnumerable> GetReadOnlyDataBuffers() + { + for (int i = 0; i < _dataBuffers.Count; i++) + { + ReadOnlyDataFrameBuffer buffer = _dataBuffers[i]; + yield return buffer.RawReadOnlyMemory; + } + } + + /// + /// Returns an enumeration of immutable buffers representing values in the Apache Arrow format + /// + /// Each encodes the indices of values in its corresponding Data buffer + /// An enumeration of objects whose elements encode the null bit maps for the column's values + public IEnumerable> GetReadOnlyNullBitMapBuffers() + { + for (int i = 0; i < _nullBitMapBuffers.Count; i++) + { + ReadOnlyDataFrameBuffer buffer = _nullBitMapBuffers[i]; + yield return buffer.RawReadOnlyMemory; + } + } + + /// + /// Returns an enumeration of immutable representing offsets into its corresponding Data buffer. + /// The Apache Arrow format specifies how the offset buffer encodes the length of each value in the Data buffer + /// + /// An enumeration of objects. + public IEnumerable> GetReadOnlyOffsetsBuffers() + { + for (int i = 0; i < _offsetsBuffers.Count; i++) + { + ReadOnlyDataFrameBuffer buffer = _offsetsBuffers[i]; + yield return buffer.ReadOnlyMemory; + } + } + + // This is an immutable column, however this method exists to support Clone(). Keep this method private + // Appending a default string is equivalent to appending null. It increases the NullCount and sets a null bitmap bit + // Appending an empty string is valid. It does NOT affect the NullCount. It instead adds a new offset entry + private void Append(ReadOnlySpan value) + { + if (_dataBuffers.Count == 0) + { + _dataBuffers.Add(new DataFrameBuffer()); + _nullBitMapBuffers.Add(new DataFrameBuffer()); + _offsetsBuffers.Add(new DataFrameBuffer()); + } + DataFrameBuffer mutableOffsetsBuffer = (DataFrameBuffer)_offsetsBuffers[_offsetsBuffers.Count - 1]; + if (mutableOffsetsBuffer.Length == 0) + { + mutableOffsetsBuffer.Append(0); + } + Length++; + if (value == default) + { + mutableOffsetsBuffer.Append(mutableOffsetsBuffer[mutableOffsetsBuffer.Length - 1]); + } + else + { + DataFrameBuffer mutableDataBuffer = (DataFrameBuffer)_dataBuffers[_dataBuffers.Count - 1]; + if (mutableDataBuffer.Length == ReadOnlyDataFrameBuffer.MaxCapacity) + { + mutableDataBuffer = new DataFrameBuffer(); + _dataBuffers.Add(mutableDataBuffer); + _nullBitMapBuffers.Add(new DataFrameBuffer()); + mutableOffsetsBuffer = new DataFrameBuffer(); + _offsetsBuffers.Add(mutableOffsetsBuffer); + mutableOffsetsBuffer.Append(0); + } + mutableDataBuffer.EnsureCapacity(value.Length); + value.CopyTo(mutableDataBuffer.RawSpan.Slice(mutableDataBuffer.Length)); + mutableDataBuffer.Length += value.Length; + mutableOffsetsBuffer.Append(mutableOffsetsBuffer[mutableOffsetsBuffer.Length - 1] + value.Length); + } + SetValidityBit(Length - 1, value != default); + + } + + private int GetBufferIndexContainingRowIndex(long rowIndex, out int indexInBuffer) + { + if (rowIndex >= Length) + { + throw new ArgumentOutOfRangeException(Strings.ColumnIndexOutOfRange, nameof(rowIndex)); + } + + // Since the strings here could be of variable length, scan linearly + int curArrayIndex = 0; + int numBuffers = _offsetsBuffers.Count; + while (curArrayIndex < numBuffers && rowIndex > _offsetsBuffers[curArrayIndex].Length - 1) + { + rowIndex -= _offsetsBuffers[curArrayIndex].Length - 1; + curArrayIndex++; + } + indexInBuffer = (int)rowIndex; + return curArrayIndex; + } + + private ReadOnlySpan GetBytes(long index) + { + int offsetsBufferIndex = GetBufferIndexContainingRowIndex(index, out int indexInBuffer); + ReadOnlySpan offsetBufferSpan = _offsetsBuffers[offsetsBufferIndex].ReadOnlySpan; + int currentOffset = offsetBufferSpan[indexInBuffer]; + int nextOffset = offsetBufferSpan[indexInBuffer + 1]; + int numberOfBytes = nextOffset - currentOffset; + return _dataBuffers[offsetsBufferIndex].ReadOnlySpan.Slice(currentOffset, numberOfBytes); + } + + /// + protected override object GetValue(long rowIndex) => GetValueImplementation(rowIndex); + + private string GetValueImplementation(long rowIndex) + { + if (!IsValid(rowIndex)) + { + return null; + } + var bytes = GetBytes(rowIndex); + unsafe + { + fixed (byte* data = &MemoryMarshal.GetReference(bytes)) + return Encoding.UTF8.GetString(data, bytes.Length); + } + } + + /// + protected override IReadOnlyList GetValues(long startIndex, int length) + { + var ret = new List(); + while (ret.Count < length) + { + ret.Add(GetValueImplementation(startIndex++)); + } + return ret; + } + + /// + protected override void SetValue(long rowIndex, object value) => throw new NotSupportedException(Strings.ImmutableColumn); + + + /// + /// Indexer to get values. This is an immutable column + /// + /// Zero based row index + /// The value stored at this + public new string this[long rowIndex] + { + get => GetValueImplementation(rowIndex); + set => throw new NotSupportedException(Strings.ImmutableColumn); + } + + /// + /// Returns number of values starting from . + /// + /// The index of the first value to return. + /// The number of values to return starting from + /// A new list of string values + public new List this[long startIndex, int length] + { + get + { + var ret = new List(); + while (ret.Count < length) + { + ret.Add(GetValueImplementation(startIndex++)); + } + return ret; + } + } + + /// + /// Returns an enumerator that iterates through the string values in this column. + /// + public IEnumerator GetEnumerator() + { + for (long i = 0; i < Length; i++) + { + yield return this[i]; + } + } + + /// + protected override IEnumerator GetEnumeratorCore() => GetEnumerator(); + + /// + protected internal override Field GetArrowField() => new Field(Name, StringType.Default, NullCount != 0); + + /// + protected internal override int GetMaxRecordBatchLength(long startIndex) + { + if (Length == 0) + return 0; + int offsetsBufferIndex = GetBufferIndexContainingRowIndex(startIndex, out int indexInBuffer); + Debug.Assert(indexInBuffer <= Int32.MaxValue); + return _offsetsBuffers[offsetsBufferIndex].Length - indexInBuffer; + } + + private int GetNullCount(long startIndex, int numberOfRows) + { + int nullCount = 0; + for (long i = startIndex; i < numberOfRows; i++) + { + if (!IsValid(i)) + nullCount++; + } + return nullCount; + } + + /// + protected internal override Apache.Arrow.Array ToArrowArray(long startIndex, int numberOfRows) + { + if (numberOfRows == 0) + return new StringArray(numberOfRows, ArrowBuffer.Empty, ArrowBuffer.Empty, ArrowBuffer.Empty); + int offsetsBufferIndex = GetBufferIndexContainingRowIndex(startIndex, out int indexInBuffer); + if (numberOfRows != 0 && numberOfRows > _offsetsBuffers[offsetsBufferIndex].Length - 1 - indexInBuffer) + { + throw new ArgumentException(Strings.SpansMultipleBuffers, nameof(numberOfRows)); + } + ArrowBuffer dataBuffer = new ArrowBuffer(_dataBuffers[offsetsBufferIndex].ReadOnlyBuffer); + ArrowBuffer offsetsBuffer = new ArrowBuffer(_offsetsBuffers[offsetsBufferIndex].ReadOnlyBuffer); + ArrowBuffer nullBuffer = new ArrowBuffer(_nullBitMapBuffers[offsetsBufferIndex].ReadOnlyBuffer); + int nullCount = GetNullCount(indexInBuffer, numberOfRows); + return new StringArray(numberOfRows, offsetsBuffer, dataBuffer, nullBuffer, nullCount, indexInBuffer); + } + + /// + public override DataFrameColumn Sort(bool ascending = true) => throw new NotSupportedException(); + + /// + public override DataFrameColumn Clone(DataFrameColumn mapIndices = null, bool invertMapIndices = false, long numberOfNullsToAppend = 0) + { + ArrowStringDataFrameColumn clone; + if (!(mapIndices is null)) + { + Type dataType = mapIndices.DataType; + if (dataType != typeof(long) && dataType != typeof(int) && dataType != typeof(bool)) + throw new ArgumentException(String.Format(Strings.MultipleMismatchedValueType, typeof(long), typeof(int), typeof(bool)), nameof(mapIndices)); + if (mapIndices.DataType == typeof(long)) + clone = Clone(mapIndices as PrimitiveDataFrameColumn, invertMapIndices); + else if (dataType == typeof(int)) + clone = Clone(mapIndices as PrimitiveDataFrameColumn, invertMapIndices); + else + clone = Clone(mapIndices as PrimitiveDataFrameColumn); + } + else + { + clone = Clone(); + } + for (long i = 0; i < numberOfNullsToAppend; i++) + { + clone.Append(default); + } + return clone; + } + + private ArrowStringDataFrameColumn Clone(PrimitiveDataFrameColumn boolColumn) + { + if (boolColumn.Length > Length) + throw new ArgumentException(Strings.MapIndicesExceedsColumnLenth, nameof(boolColumn)); + ArrowStringDataFrameColumn ret = new ArrowStringDataFrameColumn(Name); + for (long i = 0; i < boolColumn.Length; i++) + { + bool? value = boolColumn[i]; + if (value == true) + ret.Append(IsValid(i) ? GetBytes(i) : default(ReadOnlySpan)); + } + return ret; + } + + private ArrowStringDataFrameColumn CloneImplementation(PrimitiveDataFrameColumn mapIndices, bool invertMapIndices = false) + where U : unmanaged + { + ArrowStringDataFrameColumn ret = new ArrowStringDataFrameColumn(Name); + mapIndices.ApplyElementwise((U? mapIndex, long rowIndex) => + { + if (mapIndex == null) + { + ret.Append(default); + return mapIndex; + } + if (invertMapIndices) + { + long index = mapIndices.Length - 1 - rowIndex; + ret.Append(IsValid(index) ? GetBytes(index) : default(ReadOnlySpan)); + } + else + { + ret.Append(IsValid(rowIndex) ? GetBytes(rowIndex) : default(ReadOnlySpan)); + } + return mapIndex; + }); + return ret; + } + + private ArrowStringDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices = null, bool invertMapIndex = false) + { + if (mapIndices is null) + { + ArrowStringDataFrameColumn ret = new ArrowStringDataFrameColumn(Name); + for (long i = 0; i < Length; i++) + { + ret.Append(IsValid(i) ? GetBytes(i) : default(ReadOnlySpan)); + } + return ret; + } + else + return CloneImplementation(mapIndices, invertMapIndex); + } + + private ArrowStringDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices, bool invertMapIndex = false) + { + return CloneImplementation(mapIndices, invertMapIndex); + } + + /// + public override DataFrame ValueCounts() + { + Dictionary> groupedValues = GroupColumnValues(); + return StringDataFrameColumn.ValueCountsImplementation(groupedValues); + } + + /// + public override GroupBy GroupBy(int columnIndex, DataFrame parent) + { + Dictionary> dictionary = GroupColumnValues(); + return new GroupBy(parent, columnIndex, dictionary); + } + + /// + public override Dictionary> GroupColumnValues() + { + if (typeof(TKey) == typeof(string)) + { + Dictionary> multimap = new Dictionary>(EqualityComparer.Default); + for (long i = 0; i < Length; i++) + { + string str = this[i] ?? "__null__"; + bool containsKey = multimap.TryGetValue(str, out ICollection values); + if (containsKey) + { + values.Add(i); + } + else + { + multimap.Add(str, new List() { i }); + } + } + return multimap as Dictionary>; + } + else + { + throw new NotSupportedException(nameof(TKey)); + } + } + + /// + public ArrowStringDataFrameColumn FillNulls(string value, bool inPlace = false) + { + if (value == null) + { + throw new ArgumentException(nameof(value)); + } + if (inPlace) + { + /* For now throw an exception if inPlace = true. Need to investigate if Apache Arrow + * format supports filling nulls for variable length arrays + */ + throw new NotSupportedException(); + } + + ArrowStringDataFrameColumn ret = new ArrowStringDataFrameColumn(Name); + for (long i = 0; i < Length; i++) + { + ret.Append(IsValid(i) ? GetBytes(i) : Encoding.UTF8.GetBytes(value)); + } + return ret; + } + + protected override DataFrameColumn FillNullsImplementation(object value, bool inPlace) + { + if (value is string valueString) + { + return FillNulls(valueString, inPlace); + } + else + { + throw new ArgumentException(String.Format(Strings.MismatchedValueType, typeof(string)), nameof(value)); + } + } + + public override DataFrameColumn Clamp(U min, U max, bool inPlace = false) => throw new NotSupportedException(); + + public override DataFrameColumn Filter(U min, U max) => throw new NotSupportedException(); + + /// + protected internal override void AddDataViewColumn(DataViewSchema.Builder builder) + { + builder.AddColumn(Name, TextDataViewType.Instance); + } + + /// + protected internal override Delegate GetDataViewGetter(DataViewRowCursor cursor) + { + return CreateValueGetterDelegate(cursor); + } + + private ValueGetter> CreateValueGetterDelegate(DataViewRowCursor cursor) => + (ref ReadOnlyMemory value) => value = this[cursor.Position].AsMemory(); + + /// + /// Returns a boolean column that is the result of an elementwise equality comparison of each value in the column with + /// + public PrimitiveDataFrameColumn ElementwiseEquals(string value) + { + ReadOnlySpan bytes = value != null ? Encoding.UTF8.GetBytes(value) : default(ReadOnlySpan); + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name, Length); + if (value == null) + { + for (long i = 0; i < Length; i++) + { + ret[i] = !IsValid(i); + } + } + else + { + for (long i = 0; i < Length; i++) + { + var strBytes = GetBytes(i); + ret[i] = strBytes.SequenceEqual(bytes); + } + } + return ret; + } + + /// + public override PrimitiveDataFrameColumn ElementwiseEquals(T value) + { + if (value is DataFrameColumn column) + { + return ElementwiseEquals(column); + } + return ElementwiseEquals(value.ToString()); + } + + /// + public override PrimitiveDataFrameColumn ElementwiseEquals(DataFrameColumn column) + { + return StringDataFrameColumn.ElementwiseEqualsImplementation(this, column); + } + + /// + /// Returns a boolean column that is the result of an elementwise not-equal comparison of each value in the column with + /// + public PrimitiveDataFrameColumn ElementwiseNotEquals(string value) + { + ReadOnlySpan bytes = value != null ? Encoding.UTF8.GetBytes(value) : default(ReadOnlySpan); + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name, Length); + if (value == null) + { + for (long i = 0; i < Length; i++) + { + ret[i] = IsValid(i); + } + } + else + { + for (long i = 0; i < Length; i++) + { + var strBytes = GetBytes(i); + ret[i] = !strBytes.SequenceEqual(bytes); + } + } + return ret; + } + + /// + public override PrimitiveDataFrameColumn ElementwiseNotEquals(T value) + { + if (value is DataFrameColumn column) + { + return ElementwiseNotEquals(column); + } + return ElementwiseNotEquals(value.ToString()); + } + + /// + public override PrimitiveDataFrameColumn ElementwiseNotEquals(DataFrameColumn column) + { + return StringDataFrameColumn.ElementwiseNotEqualsImplementation(this, column); + } + + /// + /// Applies a function to all the values + /// + /// The function to apply + /// A containing the new string values + /// This function converts from UTF-8 to UTF-16 strings + public ArrowStringDataFrameColumn Apply(Func func) + { + ArrowStringDataFrameColumn ret = new ArrowStringDataFrameColumn(Name); + Encoding encoding = Encoding.UTF8; + for (long i = 0; i < Length; i++) + { + string cur = this[i]; + string funcResult = func(cur); + ret.Append(funcResult != null ? encoding.GetBytes(funcResult) : default(ReadOnlySpan)); + } + return ret; + } + } +} diff --git a/src/Microsoft.Data.Analysis/BooleanDataFrameColumn.cs b/src/Microsoft.Data.Analysis/BooleanDataFrameColumn.cs new file mode 100644 index 0000000000..982463d182 --- /dev/null +++ b/src/Microsoft.Data.Analysis/BooleanDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class BooleanDataFrameColumn : PrimitiveDataFrameColumn + { + public BooleanDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public BooleanDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public BooleanDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public BooleanDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal BooleanDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/ByteDataFrameColumn.cs b/src/Microsoft.Data.Analysis/ByteDataFrameColumn.cs new file mode 100644 index 0000000000..369e6d33ee --- /dev/null +++ b/src/Microsoft.Data.Analysis/ByteDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class ByteDataFrameColumn : PrimitiveDataFrameColumn + { + public ByteDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public ByteDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public ByteDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public ByteDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal ByteDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/CharDataFrameColumn.cs b/src/Microsoft.Data.Analysis/CharDataFrameColumn.cs new file mode 100644 index 0000000000..1dcedc4fc9 --- /dev/null +++ b/src/Microsoft.Data.Analysis/CharDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class CharDataFrameColumn : PrimitiveDataFrameColumn + { + public CharDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public CharDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public CharDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public CharDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal CharDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/ColumnArithmeticTemplate.ttinclude b/src/Microsoft.Data.Analysis/ColumnArithmeticTemplate.ttinclude new file mode 100644 index 0000000000..4c3e9f332b --- /dev/null +++ b/src/Microsoft.Data.Analysis/ColumnArithmeticTemplate.ttinclude @@ -0,0 +1,458 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#+ + public class TypeConfiguration + { + public TypeConfiguration(string typeName, string classPrefix = null, string oneLiteral = "1", string zeroLiteral = "0", bool supportsNumeric = true, bool supportsBitwise = true, IEnumerable unsupportedMethods = null) + { + TypeName = typeName; + ClassPrefix = classPrefix ?? char.ToUpper(typeName[0]) + typeName.Substring(1); + OneLiteral = oneLiteral; + ZeroLiteral = zeroLiteral; + SupportsNumeric = supportsNumeric; + SupportsBitwise = supportsBitwise; + UnsupportedMethods = new HashSet(unsupportedMethods ?? Enumerable.Empty()); + } + + public string TypeName { get; } + public string ClassPrefix { get; } + public string OneLiteral { get; } + public string ZeroLiteral { get; } + + public bool SupportsNumeric { get; } + public bool SupportsBitwise { get; } + public ISet UnsupportedMethods { get; } + } + + public string GenerateInPlaceStatement(string trueCondition, string falseCondition) + { + return $"inPlace ? {trueCondition} : {falseCondition}"; + } + + public string GenerateIfStatementHeader(TypeConfiguration type) + { + string keyword = (type == typeConfiguration[0]) ? "if" : "else if"; + return $"{keyword} (typeof(T) == typeof({type.TypeName}))"; + } + + // A way to discern implicit conversions. For ex: short has primitivitty 2. int has primitivitty 3. primitivitty(short) + primitivitty(int) > 2 * primitivitty(short) implying that a conversion has to take place + public Dictionary primitiveTypeToPrimitivityLevelMap = new Dictionary { + {"byte", 1}, + {"sbyte", 1}, + {"short", 2}, + {"ushort", 2}, + {"int", 3}, + {"uint", 3}, + {"long", 4}, + {"ulong", 4}, + {"float", 5}, + {"double", 6}, + {"decimal", 7} + }; + + public string GetCapitalizedPrimitiveTypes(string type) + { + string typeFirstCharUpper; + if (type.First() == 'u' || type == "sbyte") + { + typeFirstCharUpper = type[0].ToString().ToUpper() + type[1].ToString().ToUpper() + type.Substring(2); + } + else + { + typeFirstCharUpper = type[0].ToString().ToUpper() + type.Substring(1); + } + if (typeFirstCharUpper == "Bool") + { + return "Boolean"; + } + else if (typeFirstCharUpper == "Float") + { + return "Single"; + } + else if (typeFirstCharUpper == "Int") + { + return "Int32"; + } + else if (typeFirstCharUpper == "Short") + { + return "Int16"; + } + else if (typeFirstCharUpper == "Long") + { + return "Int64"; + } + else if (typeFirstCharUpper == "UInt") + { + return "UInt32"; + } + else if (typeFirstCharUpper == "UShort") + { + return "UInt16"; + } + else if (typeFirstCharUpper == "ULong") + { + return "UInt64"; + } + return typeFirstCharUpper; + } + + public bool IsMixedSignedAndUnsignedTypePair(string t1, string t2) + { + if (t1 == "byte" && t2 == "sbyte") + { + return true; + } + if (t2 == "byte" && t1 == "sbyte") + { + return true; + } + if (("u" + t1) == t2) + { + return true; + } + if (("u" + t2) == t1) + { + return true; + } + return false; + } + + // These are a subset of the implicit conversions allowed in C#. They are used to generate the return type for binary ops + // https://github.com/dotnet/csharplang/blob/master/spec/conversions.md#implicit-numeric-conversions + public Dictionary> primitiveTypeToImplicitConversions = new Dictionary> { + {"sbyte", new List {"int", "long", "float", "double", "decimal"}}, + {"byte", new List {"int", "uint", "long", "ulong", "float", "double", "decimal"}}, + {"short", new List {"int", "long", "float", "double", "decimal"}}, + {"ushort", new List {"int", "uint", "long", "ulong", "float", "double", "decimal"}}, + {"int", new List {"int", "long", "float", "double", "decimal"}}, + {"uint", new List {"uint", "long", "ulong", "float", "double", "decimal"}}, + {"long", new List {"long", "float", "double", "decimal"}}, + {"ulong", new List {"ulong", "float", "double", "decimal"}}, + {"float", new List {"float", "double"}}, + {"double", new List {"double"}}, + {"decimal", new List {"decimal"}}, + }; + + public TypeConfiguration[] typeConfiguration = new [] + { + new TypeConfiguration("bool", oneLiteral:"true", zeroLiteral:"false", supportsNumeric: false, unsupportedMethods: new[] {"LeftShift", "RightShift"}), + new TypeConfiguration("byte", unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("char", oneLiteral:"(char)1", zeroLiteral:"(char)0", unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("decimal", supportsBitwise: false, unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("double", oneLiteral:"1.0", supportsBitwise: false, unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("float", oneLiteral:"1.0f", supportsBitwise: false, unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("int", unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("long", unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("sbyte", classPrefix:"SByte", unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("short", unsupportedMethods: new[] {"All", "Any"}), + new TypeConfiguration("uint", classPrefix:"UInt", unsupportedMethods: new[] {"UnaryMinus", "All", "Any"}), + new TypeConfiguration("ulong", classPrefix:"ULong", unsupportedMethods: new[] {"UnaryMinus", "All", "Any"}), + new TypeConfiguration("ushort", classPrefix:"UShort", unsupportedMethods: new[] {"UnaryMinus", "All", "Any"}) + }; + + public string GetBinaryShiftOperationReturnType(TypeConfiguration t1) + { + primitiveTypeToImplicitConversions.TryGetValue(t1.TypeName, out IReadOnlyList t1ImplicitConversions); + return t1ImplicitConversions.First() ?? string.Empty; + } + + public string GetBinaryOperationReturnType(string t1, string t2) + { + if (t1 == "long" && t2 == "ulong" || t1 == "ulong" && t2 == "long") + { + return string.Empty; + } + primitiveTypeToImplicitConversions.TryGetValue(t1, out IReadOnlyList t1ImplicitConversions); + primitiveTypeToImplicitConversions.TryGetValue(t2, out IReadOnlyList t2ImplicitConversions); + var intersection = t1ImplicitConversions.Intersect(t2ImplicitConversions); + string ret; + if (intersection.Count() == 0) + { + ret = string.Empty; + } + else + { + ret = intersection.First(); + } + return ret; + } + + // Returns an empty string for binary ops that are not valid: For ex: float + decimal is NOT allowed. + // Special case: long + ulong is NOT allowed. The other mixed signed and unsigned are valid + public string GetBinaryOperationReturnType(TypeConfiguration t1, TypeConfiguration t2) + { + string t1Type = t1.TypeName; + string t2Type = t2.TypeName; + return GetBinaryOperationReturnType(t1Type, t2Type); + } + + public enum MethodType + { + Unary, + UnaryInPlace, + BinaryScalar, + BinaryInt, + Binary, + Comparison, + ComparisonScalar, + Contraction, + ElementwiseComputation, + Reduction + } + + public MethodConfiguration[] computationMethodConfiguration = new [] + { + new MethodConfiguration("Abs", MethodType.ElementwiseComputation, "Math.Abs", isNumeric: true, methodComments: "Updates each numeric element with its absolute numeric value"), + new MethodConfiguration("All", MethodType.Reduction, "", isBitwise: true, methodComments: "Returns whether all the elements are True"), + new MethodConfiguration("Any", MethodType.Reduction, "", isBitwise: true, methodComments: "Returns whether any element is True"), + new MethodConfiguration("CumulativeMax", MethodType.ElementwiseComputation, "", isNumeric:true, methodComments: "Updates each element with its cumulative maximum"), + new MethodConfiguration("CumulativeMax", MethodType.ElementwiseComputation, "", isNumeric:true, supportsRowSubsets: true, methodComments: "Updates column values at rowIndices with its cumulative rowIndices maximum"), + new MethodConfiguration("CumulativeMin", MethodType.ElementwiseComputation, "", isNumeric:true, methodComments: "Updates each element with its cumulative minimum"), + new MethodConfiguration("CumulativeMin", MethodType.ElementwiseComputation, "", isNumeric:true, supportsRowSubsets: true, methodComments: "Updates column values at rowIndices with its cumulative rowIndices minimum"), + new MethodConfiguration("CumulativeProduct", MethodType.ElementwiseComputation, "", isNumeric:true, methodComments: "Updates each element with its cumulative product"), + new MethodConfiguration("CumulativeProduct", MethodType.ElementwiseComputation, "", isNumeric:true, supportsRowSubsets: true, methodComments: "Updates column values at rowIndices with its cumulative rowIndices product"), + new MethodConfiguration("CumulativeSum", MethodType.ElementwiseComputation, "", isNumeric:true, methodComments: "Updates each element with its cumulative sum"), + new MethodConfiguration("CumulativeSum", MethodType.ElementwiseComputation, "", isNumeric:true, supportsRowSubsets: true, methodComments: "Updates column values at rowIndices with its cumulative rowIndices sum"), + new MethodConfiguration("Max", MethodType.Reduction, "", isNumeric:true, hasReturnValue:true, methodComments: "Returns the maximum of the values in the column"), + new MethodConfiguration("Max", MethodType.Reduction, "", isNumeric:true, hasReturnValue:true, supportsRowSubsets: true, methodComments: "Returns the maximum of the values at rowIndices"), + new MethodConfiguration("Min", MethodType.Reduction, "", isNumeric:true, hasReturnValue:true, methodComments: "Returns the minimum of the values in the column"), + new MethodConfiguration("Min", MethodType.Reduction, "", isNumeric:true, hasReturnValue:true, supportsRowSubsets: true, methodComments: "Returns the minimum of the values at the rowIndices"), + new MethodConfiguration("Product", MethodType.Reduction, "*", isNumeric:true, hasReturnValue:true, methodComments: "Returns the product of the values in the column"), + new MethodConfiguration("Product", MethodType.Reduction, "*", isNumeric:true, hasReturnValue:true, supportsRowSubsets: true, methodComments: "Returns the product of the values at the rowIndices"), + new MethodConfiguration("Sum", MethodType.Reduction, "+", isNumeric:true, hasReturnValue:true, methodComments: "Returns the sum of the values in the column"), + new MethodConfiguration("Sum", MethodType.Reduction, "+", isNumeric:true, hasReturnValue:true, supportsRowSubsets: true, methodComments: "Returns the sum of the values at the rowIndices"), + new MethodConfiguration("Round", MethodType.ElementwiseComputation, "Math.Round", isNumeric:true, methodComments: "Calls Math.Round on each value in a column"), + }; + + public MethodConfiguration[] methodConfiguration = new [] + { + new MethodConfiguration("Add", MethodType.Binary, "+", isNumeric:true, methodComments: "Performs element-wise addition"), + new MethodConfiguration("Add", MethodType.BinaryScalar, "+", isNumeric:true, methodComments: "Performs an element-wise addition on each column"), + new MethodConfiguration("Subtract", MethodType.Binary, "-", isNumeric:true, methodComments: "Performs element-wise subtraction"), + new MethodConfiguration("Subtract", MethodType.BinaryScalar, "-", isNumeric:true, methodComments: "Performs an element-wise subtraction on each column"), + new MethodConfiguration("Multiply", MethodType.Binary, "*", isNumeric:true, methodComments: "Performs element-wise multiplication"), // element-wise product, not matrix product + new MethodConfiguration("Multiply", MethodType.BinaryScalar, "*", isNumeric:true, methodComments: "Performs an element-wise multiplication on each column"), + new MethodConfiguration("Divide", MethodType.Binary, "/", isNumeric:true, methodComments: "Performs element-wise division"), + new MethodConfiguration("Divide", MethodType.BinaryScalar, "/", isNumeric:true, methodComments: "Performs an element-wise division on each column"), + new MethodConfiguration("Modulo", MethodType.Binary, "%", isNumeric:true, methodComments: "Performs element-wise modulus"), + new MethodConfiguration("Modulo", MethodType.BinaryScalar, "%", isNumeric:true, methodComments: "Performs an element-wise modulus operation on each column"), + new MethodConfiguration("And", MethodType.Binary, "&", isBitwise: true, methodComments: "Performs element-wise boolean And"), + new MethodConfiguration("And", MethodType.BinaryScalar, "&", isBitwise: true, methodComments: "Performs an element-wise boolean And on each column"), + new MethodConfiguration("Or", MethodType.Binary, "|", isBitwise: true, methodComments: "Performs element-wise boolean Or"), + new MethodConfiguration("Or", MethodType.BinaryScalar, "|", isBitwise: true, methodComments: "Performs an element-wise boolean Or on each column"), + new MethodConfiguration("Xor", MethodType.Binary, "^", isBitwise: true, methodComments: "Performs element-wise boolean Xor"), + new MethodConfiguration("Xor", MethodType.BinaryScalar, "^", isBitwise: true, methodComments: "Performs an element-wise boolean Xor on each column"), + new MethodConfiguration("LeftShift", MethodType.BinaryInt, "<<", isBitwise: true, methodComments: "Performs an element-wise left shift on each column"), + new MethodConfiguration("RightShift", MethodType.BinaryInt, ">>", isBitwise: true, methodComments: "Performs an element-wise right shift on each column"), + + new MethodConfiguration("ElementwiseEquals", MethodType.Comparison, "==", methodComments: "Performs element-wise equals"), + new MethodConfiguration("ElementwiseEquals", MethodType.ComparisonScalar, "==", methodComments: "Performs an element-wise equals on each column"), + new MethodConfiguration("ElementwiseNotEquals", MethodType.Comparison, "!=", methodComments: "Performs element-wise not-equals"), + new MethodConfiguration("ElementwiseNotEquals", MethodType.ComparisonScalar, "!=", methodComments: "Performs an element-wise not-equals on each column"), + new MethodConfiguration("ElementwiseGreaterThanOrEqual", MethodType.Comparison, ">=", isNumeric:true, methodComments: "Performs element-wise greater than or equal"), + new MethodConfiguration("ElementwiseGreaterThanOrEqual", MethodType.ComparisonScalar, ">=", isNumeric:true, methodComments: "Performs an element-wise greater than or equal on each column"), + new MethodConfiguration("ElementwiseLessThanOrEqual", MethodType.Comparison, "<=", isNumeric:true, methodComments: "Performs element-wise less than or equal"), + new MethodConfiguration("ElementwiseLessThanOrEqual", MethodType.ComparisonScalar, "<=", isNumeric:true, methodComments: "Performs an element-wise less than or equal on each column"), + new MethodConfiguration("ElementwiseGreaterThan", MethodType.Comparison, ">", isNumeric:true, methodComments: "Performs element-wise greater than"), + new MethodConfiguration("ElementwiseGreaterThan", MethodType.ComparisonScalar, ">", isNumeric:true, methodComments: "Performs an element-wise greater than on each column"), + new MethodConfiguration("ElementwiseLessThan", MethodType.Comparison, "<", isNumeric:true, methodComments: "Performs element-wise less than"), + new MethodConfiguration("ElementwiseLessThan", MethodType.ComparisonScalar, "<", isNumeric:true, methodComments: "Performs an element-wise less than on each column"), + }; + + public class MethodConfiguration + { + public MethodConfiguration(string methodName, MethodType methodType, string op = null, bool isNumeric = false, bool isBitwise = false, bool hasReturnValue = false, bool supportsRowSubsets = false, string methodComments = null) + { + MethodName = methodName; + MethodType = methodType; + Operator = op; + IsNumeric = isNumeric; + IsBitwise = isBitwise; + HasReturnValue = hasReturnValue; + SupportsRowSubsets = supportsRowSubsets; + MethodComments = methodComments; + } + + public string ResultName => "result"; + + public string Op1Name + { + get + { + switch (MethodType) + { + case MethodType.Unary: + case MethodType.UnaryInPlace: + case MethodType.BinaryScalar: + case MethodType.BinaryInt: + case MethodType.ComparisonScalar: + case MethodType.ElementwiseComputation: + case MethodType.Reduction: + return "column"; + case MethodType.Binary: + case MethodType.Comparison: + case MethodType.Contraction: + return "left"; + default: + throw new ArgumentException(); + }; + } + } + + public string Op2Name + { + get + { + switch (MethodType) + { + case MethodType.BinaryScalar: + case MethodType.ComparisonScalar: + return "scalar"; + case MethodType.BinaryInt: + return "value"; + case MethodType.Binary: + case MethodType.Comparison: + case MethodType.Contraction: + return "right"; + case MethodType.Unary: + case MethodType.UnaryInPlace: + default: + throw new ArgumentException(); + }; + } + } + + public string MethodName { get; } + public MethodType MethodType { get; } + public string Operator { get; } + public string MethodComments { get; } + + public string GetColumnSpecificMethodComments() + { + var str = MethodComments; + return str.Replace("column", "value in the column"); + } + + public string GetReverseMethodComments() + { + var str = MethodComments; + return str.Replace(" an", " a reversed"); + } + + public string GetColumnSpecificBinaryMethodComments() + { + var str = MethodComments; + str = str.Replace("column", ""); + return str.Replace(" an", " "); + } + + public string GetColumnSpecificReverseMethodComments() + { + return GetColumnSpecificMethodComments().Replace(" an", " a reversed"); + } + + public string GetMethodSignature(string columnType, string genericType) + { + var arguments = GetMethodArguments(columnType, genericType); + return $"void {MethodName}({arguments})"; + } + + public string GetInvertedMethodSignatureForBinaryScalarsOps(string columnType, string genericType) + { + var arguments = GetInvertedMethodArguments(columnType, genericType); + return $"void {MethodName}({arguments})"; + } + + public string GetSingleArgumentMethodSignature(string columnType, string genericType) + { + var arguments = GetSingleParameterMethodArguments(columnType, genericType); + return $"PrimitiveColumnContainer {MethodName}({arguments})"; + } + + public string GetComputationOrReductionMethodSignature(string columnType, string genericType) + { + var arguments = GetMethodArguments(columnType, genericType); + switch (MethodType) + { + case MethodType.ElementwiseComputation: + return $"{columnType}<{genericType}> {MethodName}({arguments})"; + case MethodType.Reduction: + return $"{genericType} {MethodName}({arguments})"; + default: + throw new ArgumentException(); + } + } + + public string GetInvertedMethodArguments(string dataFrameType, string genericType) + { + switch (MethodType) + { + case MethodType.BinaryScalar: + return $"{genericType} {Op2Name}, {dataFrameType}<{genericType}> {Op1Name}"; + default: + throw new ArgumentException(); + } + } + + public string GetMethodArguments(string dataFrameType, string genericType) + { + switch (MethodType) + { + case MethodType.Unary: + case MethodType.UnaryInPlace: + return $"{dataFrameType}<{genericType}> {Op1Name}"; + case MethodType.BinaryScalar: + return $"{dataFrameType}<{genericType}> {Op1Name}, {genericType} {Op2Name}"; + case MethodType.ComparisonScalar: + return $"{dataFrameType}<{genericType}> {Op1Name}, {genericType} {Op2Name}, {dataFrameType} ret"; + case MethodType.BinaryInt: + return $"{dataFrameType}<{genericType}> {Op1Name}, int {Op2Name}"; + case MethodType.Binary: + return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}"; + case MethodType.Comparison: + return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}, {dataFrameType} ret"; + case MethodType.Contraction: + return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}, int[] leftAxes, int[] rightAxes"; + case MethodType.ElementwiseComputation: + case MethodType.Reduction: + return $""; + default: + throw new ArgumentException(); + } + } + + public string GetSingleParameterMethodArguments(string dataFrameType, string genericType) + { + switch (MethodType) + { + case MethodType.Unary: + case MethodType.UnaryInPlace: + throw new ArgumentException(); + return $"{dataFrameType}<{genericType}> {Op1Name}"; + case MethodType.BinaryScalar: + return $"{genericType} {Op2Name}"; + case MethodType.ComparisonScalar: + return $"{genericType} {Op2Name}, {dataFrameType} ret"; + case MethodType.BinaryInt: + return $"int {Op2Name}"; + case MethodType.Binary: + return $"{dataFrameType}<{genericType}> {Op2Name}"; + case MethodType.Comparison: + return $"{dataFrameType}<{genericType}> {Op2Name}, {dataFrameType} ret"; + case MethodType.Contraction: + throw new ArgumentException(); + return $"{dataFrameType}<{genericType}> {Op1Name}, {dataFrameType}<{genericType}> {Op2Name}, int[] leftAxes, int[] rightAxes"; + default: + throw new ArgumentException(); + } + } + + public bool IsNumeric { get; } + public bool IsBitwise { get; } + public bool HasReturnValue { get; } + public bool SupportsRowSubsets { get; } + } +#> diff --git a/src/Microsoft.Data.Analysis/Converters.cs b/src/Microsoft.Data.Analysis/Converters.cs new file mode 100644 index 0000000000..a6900ea3f4 --- /dev/null +++ b/src/Microsoft.Data.Analysis/Converters.cs @@ -0,0 +1,948 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from Converters.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + internal interface IByteConverter + { + byte GetByte(T value); + } + internal static class ByteConverter + { + public static IByteConverter Instance { get; } = ByteConverter.GetByteConverter(); + } + internal static class ByteConverter + { + public static IByteConverter GetByteConverter() + { + if (typeof(T) == typeof(byte)) + { + return (IByteConverter)new ByteByteConverter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IByteConverter)new SByteByteConverter(); + } + throw new NotSupportedException(); + } + } + internal class ByteByteConverter : IByteConverter + { + public byte GetByte(byte value) + { + return (byte)value; + } + } + internal class SByteByteConverter : IByteConverter + { + public byte GetByte(sbyte value) + { + return (byte)value; + } + } + internal interface ISByteConverter + { + sbyte GetSByte(T value); + } + internal static class SByteConverter + { + public static ISByteConverter Instance { get; } = SByteConverter.GetSByteConverter(); + } + internal static class SByteConverter + { + public static ISByteConverter GetSByteConverter() + { + if (typeof(T) == typeof(byte)) + { + return (ISByteConverter)new ByteSByteConverter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (ISByteConverter)new SByteSByteConverter(); + } + throw new NotSupportedException(); + } + } + internal class ByteSByteConverter : ISByteConverter + { + public sbyte GetSByte(byte value) + { + return (sbyte)value; + } + } + internal class SByteSByteConverter : ISByteConverter + { + public sbyte GetSByte(sbyte value) + { + return (sbyte)value; + } + } + internal interface IInt16Converter + { + short GetInt16(T value); + } + internal static class Int16Converter + { + public static IInt16Converter Instance { get; } = Int16Converter.GetInt16Converter(); + } + internal static class Int16Converter + { + public static IInt16Converter GetInt16Converter() + { + if (typeof(T) == typeof(byte)) + { + return (IInt16Converter)new ByteInt16Converter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IInt16Converter)new SByteInt16Converter(); + } + if (typeof(T) == typeof(short)) + { + return (IInt16Converter)new Int16Int16Converter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IInt16Converter)new UInt16Int16Converter(); + } + throw new NotSupportedException(); + } + } + internal class ByteInt16Converter : IInt16Converter + { + public short GetInt16(byte value) + { + return (short)value; + } + } + internal class SByteInt16Converter : IInt16Converter + { + public short GetInt16(sbyte value) + { + return (short)value; + } + } + internal class Int16Int16Converter : IInt16Converter + { + public short GetInt16(short value) + { + return (short)value; + } + } + internal class UInt16Int16Converter : IInt16Converter + { + public short GetInt16(ushort value) + { + return (short)value; + } + } + internal interface IUInt16Converter + { + ushort GetUInt16(T value); + } + internal static class UInt16Converter + { + public static IUInt16Converter Instance { get; } = UInt16Converter.GetUInt16Converter(); + } + internal static class UInt16Converter + { + public static IUInt16Converter GetUInt16Converter() + { + if (typeof(T) == typeof(byte)) + { + return (IUInt16Converter)new ByteUInt16Converter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IUInt16Converter)new SByteUInt16Converter(); + } + if (typeof(T) == typeof(short)) + { + return (IUInt16Converter)new Int16UInt16Converter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IUInt16Converter)new UInt16UInt16Converter(); + } + throw new NotSupportedException(); + } + } + internal class ByteUInt16Converter : IUInt16Converter + { + public ushort GetUInt16(byte value) + { + return (ushort)value; + } + } + internal class SByteUInt16Converter : IUInt16Converter + { + public ushort GetUInt16(sbyte value) + { + return (ushort)value; + } + } + internal class Int16UInt16Converter : IUInt16Converter + { + public ushort GetUInt16(short value) + { + return (ushort)value; + } + } + internal class UInt16UInt16Converter : IUInt16Converter + { + public ushort GetUInt16(ushort value) + { + return (ushort)value; + } + } + internal interface IInt32Converter + { + int GetInt32(T value); + } + internal static class Int32Converter + { + public static IInt32Converter Instance { get; } = Int32Converter.GetInt32Converter(); + } + internal static class Int32Converter + { + public static IInt32Converter GetInt32Converter() + { + if (typeof(T) == typeof(byte)) + { + return (IInt32Converter)new ByteInt32Converter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IInt32Converter)new SByteInt32Converter(); + } + if (typeof(T) == typeof(short)) + { + return (IInt32Converter)new Int16Int32Converter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IInt32Converter)new UInt16Int32Converter(); + } + if (typeof(T) == typeof(int)) + { + return (IInt32Converter)new Int32Int32Converter(); + } + if (typeof(T) == typeof(uint)) + { + return (IInt32Converter)new UInt32Int32Converter(); + } + throw new NotSupportedException(); + } + } + internal class ByteInt32Converter : IInt32Converter + { + public int GetInt32(byte value) + { + return (int)value; + } + } + internal class SByteInt32Converter : IInt32Converter + { + public int GetInt32(sbyte value) + { + return (int)value; + } + } + internal class Int16Int32Converter : IInt32Converter + { + public int GetInt32(short value) + { + return (int)value; + } + } + internal class UInt16Int32Converter : IInt32Converter + { + public int GetInt32(ushort value) + { + return (int)value; + } + } + internal class Int32Int32Converter : IInt32Converter + { + public int GetInt32(int value) + { + return (int)value; + } + } + internal class UInt32Int32Converter : IInt32Converter + { + public int GetInt32(uint value) + { + return (int)value; + } + } + internal interface IUInt32Converter + { + uint GetUInt32(T value); + } + internal static class UInt32Converter + { + public static IUInt32Converter Instance { get; } = UInt32Converter.GetUInt32Converter(); + } + internal static class UInt32Converter + { + public static IUInt32Converter GetUInt32Converter() + { + if (typeof(T) == typeof(byte)) + { + return (IUInt32Converter)new ByteUInt32Converter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IUInt32Converter)new SByteUInt32Converter(); + } + if (typeof(T) == typeof(short)) + { + return (IUInt32Converter)new Int16UInt32Converter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IUInt32Converter)new UInt16UInt32Converter(); + } + if (typeof(T) == typeof(int)) + { + return (IUInt32Converter)new Int32UInt32Converter(); + } + if (typeof(T) == typeof(uint)) + { + return (IUInt32Converter)new UInt32UInt32Converter(); + } + throw new NotSupportedException(); + } + } + internal class ByteUInt32Converter : IUInt32Converter + { + public uint GetUInt32(byte value) + { + return (uint)value; + } + } + internal class SByteUInt32Converter : IUInt32Converter + { + public uint GetUInt32(sbyte value) + { + return (uint)value; + } + } + internal class Int16UInt32Converter : IUInt32Converter + { + public uint GetUInt32(short value) + { + return (uint)value; + } + } + internal class UInt16UInt32Converter : IUInt32Converter + { + public uint GetUInt32(ushort value) + { + return (uint)value; + } + } + internal class Int32UInt32Converter : IUInt32Converter + { + public uint GetUInt32(int value) + { + return (uint)value; + } + } + internal class UInt32UInt32Converter : IUInt32Converter + { + public uint GetUInt32(uint value) + { + return (uint)value; + } + } + internal interface IInt64Converter + { + long GetInt64(T value); + } + internal static class Int64Converter + { + public static IInt64Converter Instance { get; } = Int64Converter.GetInt64Converter(); + } + internal static class Int64Converter + { + public static IInt64Converter GetInt64Converter() + { + if (typeof(T) == typeof(byte)) + { + return (IInt64Converter)new ByteInt64Converter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IInt64Converter)new SByteInt64Converter(); + } + if (typeof(T) == typeof(short)) + { + return (IInt64Converter)new Int16Int64Converter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IInt64Converter)new UInt16Int64Converter(); + } + if (typeof(T) == typeof(int)) + { + return (IInt64Converter)new Int32Int64Converter(); + } + if (typeof(T) == typeof(uint)) + { + return (IInt64Converter)new UInt32Int64Converter(); + } + if (typeof(T) == typeof(long)) + { + return (IInt64Converter)new Int64Int64Converter(); + } + if (typeof(T) == typeof(ulong)) + { + return (IInt64Converter)new UInt64Int64Converter(); + } + throw new NotSupportedException(); + } + } + internal class ByteInt64Converter : IInt64Converter + { + public long GetInt64(byte value) + { + return (long)value; + } + } + internal class SByteInt64Converter : IInt64Converter + { + public long GetInt64(sbyte value) + { + return (long)value; + } + } + internal class Int16Int64Converter : IInt64Converter + { + public long GetInt64(short value) + { + return (long)value; + } + } + internal class UInt16Int64Converter : IInt64Converter + { + public long GetInt64(ushort value) + { + return (long)value; + } + } + internal class Int32Int64Converter : IInt64Converter + { + public long GetInt64(int value) + { + return (long)value; + } + } + internal class UInt32Int64Converter : IInt64Converter + { + public long GetInt64(uint value) + { + return (long)value; + } + } + internal class Int64Int64Converter : IInt64Converter + { + public long GetInt64(long value) + { + return (long)value; + } + } + internal class UInt64Int64Converter : IInt64Converter + { + public long GetInt64(ulong value) + { + return (long)value; + } + } + internal interface IUInt64Converter + { + ulong GetUInt64(T value); + } + internal static class UInt64Converter + { + public static IUInt64Converter Instance { get; } = UInt64Converter.GetUInt64Converter(); + } + internal static class UInt64Converter + { + public static IUInt64Converter GetUInt64Converter() + { + if (typeof(T) == typeof(byte)) + { + return (IUInt64Converter)new ByteUInt64Converter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IUInt64Converter)new SByteUInt64Converter(); + } + if (typeof(T) == typeof(short)) + { + return (IUInt64Converter)new Int16UInt64Converter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IUInt64Converter)new UInt16UInt64Converter(); + } + if (typeof(T) == typeof(int)) + { + return (IUInt64Converter)new Int32UInt64Converter(); + } + if (typeof(T) == typeof(uint)) + { + return (IUInt64Converter)new UInt32UInt64Converter(); + } + if (typeof(T) == typeof(long)) + { + return (IUInt64Converter)new Int64UInt64Converter(); + } + if (typeof(T) == typeof(ulong)) + { + return (IUInt64Converter)new UInt64UInt64Converter(); + } + throw new NotSupportedException(); + } + } + internal class ByteUInt64Converter : IUInt64Converter + { + public ulong GetUInt64(byte value) + { + return (ulong)value; + } + } + internal class SByteUInt64Converter : IUInt64Converter + { + public ulong GetUInt64(sbyte value) + { + return (ulong)value; + } + } + internal class Int16UInt64Converter : IUInt64Converter + { + public ulong GetUInt64(short value) + { + return (ulong)value; + } + } + internal class UInt16UInt64Converter : IUInt64Converter + { + public ulong GetUInt64(ushort value) + { + return (ulong)value; + } + } + internal class Int32UInt64Converter : IUInt64Converter + { + public ulong GetUInt64(int value) + { + return (ulong)value; + } + } + internal class UInt32UInt64Converter : IUInt64Converter + { + public ulong GetUInt64(uint value) + { + return (ulong)value; + } + } + internal class Int64UInt64Converter : IUInt64Converter + { + public ulong GetUInt64(long value) + { + return (ulong)value; + } + } + internal class UInt64UInt64Converter : IUInt64Converter + { + public ulong GetUInt64(ulong value) + { + return (ulong)value; + } + } + internal interface ISingleConverter + { + float GetSingle(T value); + } + internal static class SingleConverter + { + public static ISingleConverter Instance { get; } = SingleConverter.GetSingleConverter(); + } + internal static class SingleConverter + { + public static ISingleConverter GetSingleConverter() + { + if (typeof(T) == typeof(byte)) + { + return (ISingleConverter)new ByteSingleConverter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (ISingleConverter)new SByteSingleConverter(); + } + if (typeof(T) == typeof(short)) + { + return (ISingleConverter)new Int16SingleConverter(); + } + if (typeof(T) == typeof(ushort)) + { + return (ISingleConverter)new UInt16SingleConverter(); + } + if (typeof(T) == typeof(int)) + { + return (ISingleConverter)new Int32SingleConverter(); + } + if (typeof(T) == typeof(uint)) + { + return (ISingleConverter)new UInt32SingleConverter(); + } + if (typeof(T) == typeof(long)) + { + return (ISingleConverter)new Int64SingleConverter(); + } + if (typeof(T) == typeof(ulong)) + { + return (ISingleConverter)new UInt64SingleConverter(); + } + if (typeof(T) == typeof(float)) + { + return (ISingleConverter)new SingleSingleConverter(); + } + throw new NotSupportedException(); + } + } + internal class ByteSingleConverter : ISingleConverter + { + public float GetSingle(byte value) + { + return (float)value; + } + } + internal class SByteSingleConverter : ISingleConverter + { + public float GetSingle(sbyte value) + { + return (float)value; + } + } + internal class Int16SingleConverter : ISingleConverter + { + public float GetSingle(short value) + { + return (float)value; + } + } + internal class UInt16SingleConverter : ISingleConverter + { + public float GetSingle(ushort value) + { + return (float)value; + } + } + internal class Int32SingleConverter : ISingleConverter + { + public float GetSingle(int value) + { + return (float)value; + } + } + internal class UInt32SingleConverter : ISingleConverter + { + public float GetSingle(uint value) + { + return (float)value; + } + } + internal class Int64SingleConverter : ISingleConverter + { + public float GetSingle(long value) + { + return (float)value; + } + } + internal class UInt64SingleConverter : ISingleConverter + { + public float GetSingle(ulong value) + { + return (float)value; + } + } + internal class SingleSingleConverter : ISingleConverter + { + public float GetSingle(float value) + { + return (float)value; + } + } + internal interface IDoubleConverter + { + double GetDouble(T value); + } + internal static class DoubleConverter + { + public static IDoubleConverter Instance { get; } = DoubleConverter.GetDoubleConverter(); + } + internal static class DoubleConverter + { + public static IDoubleConverter GetDoubleConverter() + { + if (typeof(T) == typeof(byte)) + { + return (IDoubleConverter)new ByteDoubleConverter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IDoubleConverter)new SByteDoubleConverter(); + } + if (typeof(T) == typeof(short)) + { + return (IDoubleConverter)new Int16DoubleConverter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IDoubleConverter)new UInt16DoubleConverter(); + } + if (typeof(T) == typeof(int)) + { + return (IDoubleConverter)new Int32DoubleConverter(); + } + if (typeof(T) == typeof(uint)) + { + return (IDoubleConverter)new UInt32DoubleConverter(); + } + if (typeof(T) == typeof(long)) + { + return (IDoubleConverter)new Int64DoubleConverter(); + } + if (typeof(T) == typeof(ulong)) + { + return (IDoubleConverter)new UInt64DoubleConverter(); + } + if (typeof(T) == typeof(float)) + { + return (IDoubleConverter)new SingleDoubleConverter(); + } + if (typeof(T) == typeof(double)) + { + return (IDoubleConverter)new DoubleDoubleConverter(); + } + throw new NotSupportedException(); + } + } + internal class ByteDoubleConverter : IDoubleConverter + { + public double GetDouble(byte value) + { + return (double)value; + } + } + internal class SByteDoubleConverter : IDoubleConverter + { + public double GetDouble(sbyte value) + { + return (double)value; + } + } + internal class Int16DoubleConverter : IDoubleConverter + { + public double GetDouble(short value) + { + return (double)value; + } + } + internal class UInt16DoubleConverter : IDoubleConverter + { + public double GetDouble(ushort value) + { + return (double)value; + } + } + internal class Int32DoubleConverter : IDoubleConverter + { + public double GetDouble(int value) + { + return (double)value; + } + } + internal class UInt32DoubleConverter : IDoubleConverter + { + public double GetDouble(uint value) + { + return (double)value; + } + } + internal class Int64DoubleConverter : IDoubleConverter + { + public double GetDouble(long value) + { + return (double)value; + } + } + internal class UInt64DoubleConverter : IDoubleConverter + { + public double GetDouble(ulong value) + { + return (double)value; + } + } + internal class SingleDoubleConverter : IDoubleConverter + { + public double GetDouble(float value) + { + return (double)value; + } + } + internal class DoubleDoubleConverter : IDoubleConverter + { + public double GetDouble(double value) + { + return (double)value; + } + } + internal interface IDecimalConverter + { + decimal GetDecimal(T value); + } + internal static class DecimalConverter + { + public static IDecimalConverter Instance { get; } = DecimalConverter.GetDecimalConverter(); + } + internal static class DecimalConverter + { + public static IDecimalConverter GetDecimalConverter() + { + if (typeof(T) == typeof(byte)) + { + return (IDecimalConverter)new ByteDecimalConverter(); + } + if (typeof(T) == typeof(sbyte)) + { + return (IDecimalConverter)new SByteDecimalConverter(); + } + if (typeof(T) == typeof(short)) + { + return (IDecimalConverter)new Int16DecimalConverter(); + } + if (typeof(T) == typeof(ushort)) + { + return (IDecimalConverter)new UInt16DecimalConverter(); + } + if (typeof(T) == typeof(int)) + { + return (IDecimalConverter)new Int32DecimalConverter(); + } + if (typeof(T) == typeof(uint)) + { + return (IDecimalConverter)new UInt32DecimalConverter(); + } + if (typeof(T) == typeof(long)) + { + return (IDecimalConverter)new Int64DecimalConverter(); + } + if (typeof(T) == typeof(ulong)) + { + return (IDecimalConverter)new UInt64DecimalConverter(); + } + if (typeof(T) == typeof(float)) + { + return (IDecimalConverter)new SingleDecimalConverter(); + } + if (typeof(T) == typeof(double)) + { + return (IDecimalConverter)new DoubleDecimalConverter(); + } + if (typeof(T) == typeof(decimal)) + { + return (IDecimalConverter)new DecimalDecimalConverter(); + } + throw new NotSupportedException(); + } + } + internal class ByteDecimalConverter : IDecimalConverter + { + public decimal GetDecimal(byte value) + { + return (decimal)value; + } + } + internal class SByteDecimalConverter : IDecimalConverter + { + public decimal GetDecimal(sbyte value) + { + return (decimal)value; + } + } + internal class Int16DecimalConverter : IDecimalConverter + { + public decimal GetDecimal(short value) + { + return (decimal)value; + } + } + internal class UInt16DecimalConverter : IDecimalConverter + { + public decimal GetDecimal(ushort value) + { + return (decimal)value; + } + } + internal class Int32DecimalConverter : IDecimalConverter + { + public decimal GetDecimal(int value) + { + return (decimal)value; + } + } + internal class UInt32DecimalConverter : IDecimalConverter + { + public decimal GetDecimal(uint value) + { + return (decimal)value; + } + } + internal class Int64DecimalConverter : IDecimalConverter + { + public decimal GetDecimal(long value) + { + return (decimal)value; + } + } + internal class UInt64DecimalConverter : IDecimalConverter + { + public decimal GetDecimal(ulong value) + { + return (decimal)value; + } + } + internal class SingleDecimalConverter : IDecimalConverter + { + public decimal GetDecimal(float value) + { + return (decimal)value; + } + } + internal class DoubleDecimalConverter : IDecimalConverter + { + public decimal GetDecimal(double value) + { + return (decimal)value; + } + } + internal class DecimalDecimalConverter : IDecimalConverter + { + public decimal GetDecimal(decimal value) + { + return (decimal)value; + } + } +} diff --git a/src/Microsoft.Data.Analysis/Converters.tt b/src/Microsoft.Data.Analysis/Converters.tt new file mode 100644 index 0000000000..c21661f75e --- /dev/null +++ b/src/Microsoft.Data.Analysis/Converters.tt @@ -0,0 +1,84 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from Converters.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ +<# + foreach (var typeToLevel in primitiveTypeToPrimitivityLevelMap) + { + string type = typeToLevel.Key; + int level = typeToLevel.Value; + string typeFirstCharUpper = GetCapitalizedPrimitiveTypes(type); +#> + internal interface I<#=typeFirstCharUpper#>Converter + { + <#=type#> Get<#=typeFirstCharUpper#>(T value); + } + internal static class <#=typeFirstCharUpper#>Converter + { + public static I<#=typeFirstCharUpper#>Converter Instance { get; } = <#=typeFirstCharUpper#>Converter.Get<#=typeFirstCharUpper#>Converter(); + } + internal static class <#=typeFirstCharUpper#>Converter + { + public static I<#=typeFirstCharUpper#>Converter Get<#=typeFirstCharUpper#>Converter() + { +<# + foreach (var typeLoop in primitiveTypeToPrimitivityLevelMap) + { + int loopLevel = typeLoop.Value; + if (loopLevel > level) + { + continue; + } +#> + if (typeof(T) == typeof(<#=typeLoop.Key#>)) + { +<# + string capitalizedLoopPrimitive = GetCapitalizedPrimitiveTypes(typeLoop.Key); +#> + return (I<#=typeFirstCharUpper#>Converter)new <#=capitalizedLoopPrimitive#><#=typeFirstCharUpper#>Converter(); + } +<# + } +#> + throw new NotSupportedException(); + } + } +<# + // Generate the individual type converter classes + foreach (var typeLoop in primitiveTypeToPrimitivityLevelMap) + { + int loopLevel = typeLoop.Value; + if (loopLevel > level) + { + continue; + } + string capitalizedLoopPrimitive = GetCapitalizedPrimitiveTypes(typeLoop.Key); +#> + internal class <#=capitalizedLoopPrimitive#><#=typeFirstCharUpper#>Converter : I<#=typeFirstCharUpper#>Converter<<#=typeLoop.Key#>> + { + public <#=type#> Get<#=typeFirstCharUpper#>(<#=typeLoop.Key#> value) + { + return (<#=type#>)value; + } + } +<# + } +#> +<# + } +#> +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.Arrow.cs b/src/Microsoft.Data.Analysis/DataFrame.Arrow.cs new file mode 100644 index 0000000000..cb08176197 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.Arrow.cs @@ -0,0 +1,188 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using Apache.Arrow; +using Apache.Arrow.Types; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame + { + private static void AppendDataFrameColumnFromArrowArray(Field field, IArrowArray arrowArray, DataFrame ret, string fieldNamePrefix = "") + { + IArrowType fieldType = field.DataType; + DataFrameColumn dataFrameColumn = null; + string fieldName = fieldNamePrefix + field.Name; + switch (fieldType.TypeId) + { + case ArrowTypeId.Boolean: + BooleanArray arrowBooleanArray = (BooleanArray)arrowArray; + ReadOnlyMemory valueBuffer = arrowBooleanArray.ValueBuffer.Memory; + ReadOnlyMemory nullBitMapBuffer = arrowBooleanArray.NullBitmapBuffer.Memory; + dataFrameColumn = new BooleanDataFrameColumn(fieldName, valueBuffer, nullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Double: + PrimitiveArray arrowDoubleArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory doubleValueBuffer = arrowDoubleArray.ValueBuffer.Memory; + ReadOnlyMemory doubleNullBitMapBuffer = arrowDoubleArray.NullBitmapBuffer.Memory; + dataFrameColumn = new DoubleDataFrameColumn(fieldName, doubleValueBuffer, doubleNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Float: + PrimitiveArray arrowFloatArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory floatValueBuffer = arrowFloatArray.ValueBuffer.Memory; + ReadOnlyMemory floatNullBitMapBuffer = arrowFloatArray.NullBitmapBuffer.Memory; + dataFrameColumn = new SingleDataFrameColumn(fieldName, floatValueBuffer, floatNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Int8: + PrimitiveArray arrowsbyteArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory sbyteValueBuffer = arrowsbyteArray.ValueBuffer.Memory; + ReadOnlyMemory sbyteNullBitMapBuffer = arrowsbyteArray.NullBitmapBuffer.Memory; + dataFrameColumn = new SByteDataFrameColumn(fieldName, sbyteValueBuffer, sbyteNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Int16: + PrimitiveArray arrowshortArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory shortValueBuffer = arrowshortArray.ValueBuffer.Memory; + ReadOnlyMemory shortNullBitMapBuffer = arrowshortArray.NullBitmapBuffer.Memory; + dataFrameColumn = new Int16DataFrameColumn(fieldName, shortValueBuffer, shortNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Int32: + PrimitiveArray arrowIntArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory intValueBuffer = arrowIntArray.ValueBuffer.Memory; + ReadOnlyMemory intNullBitMapBuffer = arrowIntArray.NullBitmapBuffer.Memory; + dataFrameColumn = new Int32DataFrameColumn(fieldName, intValueBuffer, intNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Int64: + PrimitiveArray arrowLongArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory longValueBuffer = arrowLongArray.ValueBuffer.Memory; + ReadOnlyMemory longNullBitMapBuffer = arrowLongArray.NullBitmapBuffer.Memory; + dataFrameColumn = new Int64DataFrameColumn(fieldName, longValueBuffer, longNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.String: + StringArray stringArray = (StringArray)arrowArray; + ReadOnlyMemory dataMemory = stringArray.ValueBuffer.Memory; + ReadOnlyMemory offsetsMemory = stringArray.ValueOffsetsBuffer.Memory; + ReadOnlyMemory nullMemory = stringArray.NullBitmapBuffer.Memory; + dataFrameColumn = new ArrowStringDataFrameColumn(fieldName, dataMemory, offsetsMemory, nullMemory, stringArray.Length, stringArray.NullCount); + break; + case ArrowTypeId.UInt8: + PrimitiveArray arrowbyteArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory byteValueBuffer = arrowbyteArray.ValueBuffer.Memory; + ReadOnlyMemory byteNullBitMapBuffer = arrowbyteArray.NullBitmapBuffer.Memory; + dataFrameColumn = new ByteDataFrameColumn(fieldName, byteValueBuffer, byteNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.UInt16: + PrimitiveArray arrowUshortArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory ushortValueBuffer = arrowUshortArray.ValueBuffer.Memory; + ReadOnlyMemory ushortNullBitMapBuffer = arrowUshortArray.NullBitmapBuffer.Memory; + dataFrameColumn = new UInt16DataFrameColumn(fieldName, ushortValueBuffer, ushortNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.UInt32: + PrimitiveArray arrowUintArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory uintValueBuffer = arrowUintArray.ValueBuffer.Memory; + ReadOnlyMemory uintNullBitMapBuffer = arrowUintArray.NullBitmapBuffer.Memory; + dataFrameColumn = new UInt32DataFrameColumn(fieldName, uintValueBuffer, uintNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.UInt64: + PrimitiveArray arrowUlongArray = (PrimitiveArray)arrowArray; + ReadOnlyMemory ulongValueBuffer = arrowUlongArray.ValueBuffer.Memory; + ReadOnlyMemory ulongNullBitMapBuffer = arrowUlongArray.NullBitmapBuffer.Memory; + dataFrameColumn = new UInt64DataFrameColumn(fieldName, ulongValueBuffer, ulongNullBitMapBuffer, arrowArray.Length, arrowArray.NullCount); + break; + case ArrowTypeId.Struct: + StructArray structArray = (StructArray)arrowArray; + StructType structType = (StructType)field.DataType; + IEnumerator fieldsEnumerator = structType.Fields.GetEnumerator(); + IEnumerator structArrayEnumerator = structArray.Fields.GetEnumerator(); + while (fieldsEnumerator.MoveNext() && structArrayEnumerator.MoveNext()) + { + AppendDataFrameColumnFromArrowArray(fieldsEnumerator.Current, structArrayEnumerator.Current, ret, field.Name + "_"); + } + break; + case ArrowTypeId.Decimal: + case ArrowTypeId.Binary: + case ArrowTypeId.Date32: + case ArrowTypeId.Date64: + case ArrowTypeId.Dictionary: + case ArrowTypeId.FixedSizedBinary: + case ArrowTypeId.HalfFloat: + case ArrowTypeId.Interval: + case ArrowTypeId.List: + case ArrowTypeId.Map: + case ArrowTypeId.Null: + case ArrowTypeId.Time32: + case ArrowTypeId.Time64: + default: + throw new NotImplementedException(nameof(fieldType.Name)); + } + + if (dataFrameColumn != null) + { + ret.Columns.Insert(ret.Columns.Count, dataFrameColumn); + } + } + + /// + /// Wraps a around an Arrow without copying data + /// + /// + /// + public static DataFrame FromArrowRecordBatch(RecordBatch recordBatch) + { + DataFrame ret = new DataFrame(); + Apache.Arrow.Schema arrowSchema = recordBatch.Schema; + int fieldIndex = 0; + IEnumerable arrowArrays = recordBatch.Arrays; + foreach (IArrowArray arrowArray in arrowArrays) + { + Field field = arrowSchema.GetFieldByIndex(fieldIndex); + AppendDataFrameColumnFromArrowArray(field, arrowArray, ret); + fieldIndex++; + } + return ret; + } + + /// + /// Returns an without copying data + /// + public IEnumerable ToArrowRecordBatches() + { + Apache.Arrow.Schema.Builder schemaBuilder = new Apache.Arrow.Schema.Builder(); + + int columnCount = Columns.Count; + for (int i = 0; i < columnCount; i++) + { + DataFrameColumn column = Columns[i]; + Field field = column.GetArrowField(); + schemaBuilder.Field(field); + } + + Schema schema = schemaBuilder.Build(); + List arrays = new List(); + + int recordBatchLength = Int32.MaxValue; + int numberOfRowsInThisRecordBatch = (int)Math.Min(recordBatchLength, Rows.Count); + long numberOfRowsProcessed = 0; + + // Sometimes .NET for Spark passes in DataFrames with no rows. In those cases, we just return a RecordBatch with the right Schema and no rows + do + { + for (int i = 0; i < columnCount; i++) + { + DataFrameColumn column = Columns[i]; + numberOfRowsInThisRecordBatch = (int)Math.Min(numberOfRowsInThisRecordBatch, column.GetMaxRecordBatchLength(numberOfRowsProcessed)); + } + for (int i = 0; i < columnCount; i++) + { + DataFrameColumn column = Columns[i]; + arrays.Add(column.ToArrowArray(numberOfRowsProcessed, numberOfRowsInThisRecordBatch)); + } + numberOfRowsProcessed += numberOfRowsInThisRecordBatch; + yield return new RecordBatch(schema, arrays, numberOfRowsInThisRecordBatch); + } while (numberOfRowsProcessed < Rows.Count); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.BinaryOperations.cs b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperations.cs new file mode 100644 index 0000000000..4be928ea9a --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperations.cs @@ -0,0 +1,698 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameBinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame + { + public DataFrame Add(IReadOnlyList values, bool inPlace = false) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Add(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise addition on each column + /// + public DataFrame Add(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Add(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame Subtract(IReadOnlyList values, bool inPlace = false) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Subtract(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise subtraction on each column + /// + public DataFrame Subtract(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Subtract(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame Multiply(IReadOnlyList values, bool inPlace = false) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Multiply(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise multiplication on each column + /// + public DataFrame Multiply(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Multiply(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame Divide(IReadOnlyList values, bool inPlace = false) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Divide(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise division on each column + /// + public DataFrame Divide(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Divide(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame Modulo(IReadOnlyList values, bool inPlace = false) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Modulo(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise modulus operation on each column + /// + public DataFrame Modulo(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Modulo(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame And(IReadOnlyList values, bool inPlace = false) + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.And(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise boolean And on each column + /// + public DataFrame And(bool value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.And(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame Or(IReadOnlyList values, bool inPlace = false) + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Or(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise boolean Or on each column + /// + public DataFrame Or(bool value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Or(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame Xor(IReadOnlyList values, bool inPlace = false) + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Xor(values[i], inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise boolean Xor on each column + /// + public DataFrame Xor(bool value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Xor(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise left shift on each column + /// + public DataFrame LeftShift(int value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.LeftShift(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise right shift on each column + /// + public DataFrame RightShift(int value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.RightShift(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame ElementwiseEquals(IReadOnlyList values) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseEquals(values[i]); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise equals on each column + /// + public DataFrame ElementwiseEquals(T value) + where T : unmanaged + { + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseEquals(value); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame ElementwiseNotEquals(IReadOnlyList values) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseNotEquals(values[i]); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise not-equals on each column + /// + public DataFrame ElementwiseNotEquals(T value) + where T : unmanaged + { + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseNotEquals(value); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame ElementwiseGreaterThanOrEqual(IReadOnlyList values) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseGreaterThanOrEqual(values[i]); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise greater than or equal on each column + /// + public DataFrame ElementwiseGreaterThanOrEqual(T value) + where T : unmanaged + { + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseGreaterThanOrEqual(value); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame ElementwiseLessThanOrEqual(IReadOnlyList values) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseLessThanOrEqual(values[i]); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise less than or equal on each column + /// + public DataFrame ElementwiseLessThanOrEqual(T value) + where T : unmanaged + { + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseLessThanOrEqual(value); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame ElementwiseGreaterThan(IReadOnlyList values) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseGreaterThan(values[i]); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise greater than on each column + /// + public DataFrame ElementwiseGreaterThan(T value) + where T : unmanaged + { + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseGreaterThan(value); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + public DataFrame ElementwiseLessThan(IReadOnlyList values) + where T : unmanaged + { + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseLessThan(values[i]); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs an element-wise less than on each column + /// + public DataFrame ElementwiseLessThan(T value) + where T : unmanaged + { + DataFrame retDataFrame = new DataFrame(); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ElementwiseLessThan(value); + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + + /// + /// Performs a reversed element-wise addition on each column + /// + public DataFrame ReverseAdd(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseAdd(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise subtraction on each column + /// + public DataFrame ReverseSubtract(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseSubtract(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise multiplication on each column + /// + public DataFrame ReverseMultiply(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseMultiply(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise division on each column + /// + public DataFrame ReverseDivide(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseDivide(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise modulus operation on each column + /// + public DataFrame ReverseModulo(T value, bool inPlace = false) + where T : unmanaged + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseModulo(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise boolean And on each column + /// + public DataFrame ReverseAnd(bool value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseAnd(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise boolean Or on each column + /// + public DataFrame ReverseOr(bool value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseOr(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + /// + /// Performs a reversed element-wise boolean Xor on each column + /// + public DataFrame ReverseXor(bool value, bool inPlace = false) + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.ReverseXor(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.BinaryOperations.tt b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperations.tt new file mode 100644 index 0000000000..cbd854109e --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperations.tt @@ -0,0 +1,136 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameBinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame + { +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) { #> +<# if (method.IsBitwise == true) { #> + /// + /// <#=method.MethodComments#> + /// + public DataFrame <#=method.MethodName#>(bool value, bool inPlace = false) +<# } else { #> + /// + /// <#=method.MethodComments#> + /// + public DataFrame <#=method.MethodName#>(T value, bool inPlace = false) + where T : unmanaged +<# } #> +<# } #> +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + /// + /// <#=method.MethodComments#> + /// + public DataFrame <#=method.MethodName#>(T value) + where T : unmanaged +<# } #> +<# if (method.MethodType == MethodType.Binary) {#> +<# if (method.IsBitwise == true) { #> + public DataFrame <#=method.MethodName#>(IReadOnlyList values, bool inPlace = false) +<# } else { #> + public DataFrame <#=method.MethodName#>(IReadOnlyList values, bool inPlace = false) + where T : unmanaged +<# } #> +<# } #> +<# if (method.MethodType == MethodType.Comparison) {#> + public DataFrame <#=method.MethodName#>(IReadOnlyList values) + where T : unmanaged +<# } #> +<# if (method.MethodType == MethodType.BinaryInt ) {#> + /// + /// <#=method.MethodComments#> + /// + public DataFrame <#=method.MethodName#>(int value, bool inPlace = false) +<# } #> + { +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.BinaryInt) {#> +<# } else { #> + if (values.Count != Columns.Count) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + } +<# } #> +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.Binary || method.MethodType == MethodType.BinaryInt) {#> + DataFrame retDataFrame = inPlace ? this : new DataFrame(); +<# } else { #> + DataFrame retDataFrame = new DataFrame(); +<# } #> + +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.Binary || method.MethodType == MethodType.BinaryInt) {#> + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; +<# } else { #> + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; +<# } #> +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.BinaryInt) {#> + DataFrameColumn newColumn = baseColumn.<#=method.MethodName#>(value, inPlace); +<# } else if (method.MethodType == MethodType.Binary) { #> + DataFrameColumn newColumn = baseColumn.<#=method.MethodName#>(values[i], inPlace); +<# } else if (method.MethodType == MethodType.ComparisonScalar) { #> + DataFrameColumn newColumn = baseColumn.<#=method.MethodName#>(value); +<# } else { #> + DataFrameColumn newColumn = baseColumn.<#=method.MethodName#>(values[i]); +<# } #> +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.Binary || method.MethodType == MethodType.BinaryInt) {#> + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); +<# } else { #> + retDataFrame.Columns.Insert(i, newColumn); +<# } #> + } + return retDataFrame; + } +<# } #> + +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) { #> +<# if (method.IsBitwise == true) { #> + /// + /// <#=method.GetReverseMethodComments()#> + /// + public DataFrame Reverse<#=method.MethodName#>(bool value, bool inPlace = false) +<# } else { #> + /// + /// <#=method.GetReverseMethodComments()#> + /// + public DataFrame Reverse<#=method.MethodName#>(T value, bool inPlace = false) + where T : unmanaged +<# } #> + { + DataFrame retDataFrame = inPlace ? this : new DataFrame(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = _columnCollection[i]; + DataFrameColumn newColumn = baseColumn.Reverse<#=method.MethodName#>(value, inPlace); + if (inPlace) + retDataFrame.Columns[i] = newColumn; + else + retDataFrame.Columns.Insert(i, newColumn); + } + return retDataFrame; + } +<# } #> +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.BinaryOperators.cs b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperators.cs new file mode 100644 index 0000000000..395143a90b --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperators.cs @@ -0,0 +1,577 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameBinaryOperators.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame + { + #pragma warning disable 1591 + public static DataFrame operator +(DataFrame df, byte value) + { + return df.Add(value); + } + + public static DataFrame operator +(byte value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, decimal value) + { + return df.Add(value); + } + + public static DataFrame operator +(decimal value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, double value) + { + return df.Add(value); + } + + public static DataFrame operator +(double value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, float value) + { + return df.Add(value); + } + + public static DataFrame operator +(float value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, int value) + { + return df.Add(value); + } + + public static DataFrame operator +(int value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, long value) + { + return df.Add(value); + } + + public static DataFrame operator +(long value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, sbyte value) + { + return df.Add(value); + } + + public static DataFrame operator +(sbyte value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, short value) + { + return df.Add(value); + } + + public static DataFrame operator +(short value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, uint value) + { + return df.Add(value); + } + + public static DataFrame operator +(uint value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, ulong value) + { + return df.Add(value); + } + + public static DataFrame operator +(ulong value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator +(DataFrame df, ushort value) + { + return df.Add(value); + } + + public static DataFrame operator +(ushort value, DataFrame df) + { + return df.ReverseAdd(value); + } + + public static DataFrame operator -(DataFrame df, byte value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(byte value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, decimal value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(decimal value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, double value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(double value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, float value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(float value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, int value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(int value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, long value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(long value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, sbyte value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(sbyte value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, short value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(short value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, uint value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(uint value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, ulong value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(ulong value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator -(DataFrame df, ushort value) + { + return df.Subtract(value); + } + + public static DataFrame operator -(ushort value, DataFrame df) + { + return df.ReverseSubtract(value); + } + + public static DataFrame operator *(DataFrame df, byte value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(byte value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, decimal value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(decimal value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, double value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(double value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, float value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(float value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, int value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(int value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, long value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(long value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, sbyte value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(sbyte value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, short value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(short value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, uint value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(uint value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, ulong value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(ulong value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator *(DataFrame df, ushort value) + { + return df.Multiply(value); + } + + public static DataFrame operator *(ushort value, DataFrame df) + { + return df.ReverseMultiply(value); + } + + public static DataFrame operator /(DataFrame df, byte value) + { + return df.Divide(value); + } + + public static DataFrame operator /(byte value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, decimal value) + { + return df.Divide(value); + } + + public static DataFrame operator /(decimal value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, double value) + { + return df.Divide(value); + } + + public static DataFrame operator /(double value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, float value) + { + return df.Divide(value); + } + + public static DataFrame operator /(float value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, int value) + { + return df.Divide(value); + } + + public static DataFrame operator /(int value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, long value) + { + return df.Divide(value); + } + + public static DataFrame operator /(long value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, sbyte value) + { + return df.Divide(value); + } + + public static DataFrame operator /(sbyte value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, short value) + { + return df.Divide(value); + } + + public static DataFrame operator /(short value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, uint value) + { + return df.Divide(value); + } + + public static DataFrame operator /(uint value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, ulong value) + { + return df.Divide(value); + } + + public static DataFrame operator /(ulong value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator /(DataFrame df, ushort value) + { + return df.Divide(value); + } + + public static DataFrame operator /(ushort value, DataFrame df) + { + return df.ReverseDivide(value); + } + + public static DataFrame operator %(DataFrame df, byte value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(byte value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, decimal value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(decimal value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, double value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(double value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, float value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(float value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, int value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(int value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, long value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(long value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, sbyte value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(sbyte value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, short value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(short value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, uint value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(uint value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, ulong value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(ulong value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator %(DataFrame df, ushort value) + { + return df.Modulo(value); + } + + public static DataFrame operator %(ushort value, DataFrame df) + { + return df.ReverseModulo(value); + } + + public static DataFrame operator <<(DataFrame df, int value) + { + return df.LeftShift(value); + } + + public static DataFrame operator >>(DataFrame df, int value) + { + return df.RightShift(value); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.BinaryOperators.tt b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperators.tt new file mode 100644 index 0000000000..52cbb913a7 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.BinaryOperators.tt @@ -0,0 +1,52 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameBinaryOperators.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame + { + #pragma warning disable 1591 +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) { #> +<# if (method.IsBitwise == true) { #> +<# // There seem to be very few use cases for an API such as df.And/Or/Xor(true). #> +<# continue; #> +<# } else { #> +<# foreach (TypeConfiguration type in typeConfiguration) { #> +<# if (method.IsNumeric != type.SupportsNumeric) continue; #> +<# if (method.IsNumeric && type.TypeName == "char") continue; #> + public static DataFrame operator <#=method.Operator#>(DataFrame df, <#=type.TypeName#> value) + { + return df.<#=method.MethodName#>(value); + } + + public static DataFrame operator <#=method.Operator#>(<#=type.TypeName#> value, DataFrame df) + { + return df.Reverse<#=method.MethodName#>(value); + } + +<# } #> +<# } #> +<# } else if (method.MethodType == MethodType.BinaryInt) {#> + public static DataFrame operator <#=method.Operator#>(DataFrame df, int value) + { + return df.<#=method.MethodName#>(value); + } + +<# } #> +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.IDataView.cs b/src/Microsoft.Data.Analysis/DataFrame.IDataView.cs new file mode 100644 index 0000000000..4755f296f4 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.IDataView.cs @@ -0,0 +1,140 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Microsoft.ML; +using Microsoft.ML.Data; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame : IDataView + { + // TODO: support shuffling + bool IDataView.CanShuffle => false; + + private DataViewSchema _schema; + private DataViewSchema DataViewSchema + { + get + { + if (_schema != null) + { + return _schema; + } + + var schemaBuilder = new DataViewSchema.Builder(); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn baseColumn = Columns[i]; + baseColumn.AddDataViewColumn(schemaBuilder); + } + _schema = schemaBuilder.ToSchema(); + return _schema; + } + } + + DataViewSchema IDataView.Schema => DataViewSchema; + + long? IDataView.GetRowCount() => Rows.Count; + + private DataViewRowCursor GetRowCursorCore(IEnumerable columnsNeeded) + { + var activeColumns = new bool[DataViewSchema.Count]; + foreach (DataViewSchema.Column column in columnsNeeded) + { + if (column.Index < activeColumns.Length) + { + activeColumns[column.Index] = true; + } + } + + return new RowCursor(this, activeColumns); + } + DataViewRowCursor IDataView.GetRowCursor(IEnumerable columnsNeeded, Random rand) + { + return GetRowCursorCore(columnsNeeded); + } + + DataViewRowCursor[] IDataView.GetRowCursorSet(IEnumerable columnsNeeded, int n, Random rand) + { + // TODO: change to support parallel cursors + return new DataViewRowCursor[] { GetRowCursorCore(columnsNeeded) }; + } + + private sealed class RowCursor : DataViewRowCursor + { + private bool _disposed; + private long _position; + private readonly DataFrame _dataFrame; + private readonly Delegate[] _getters; + + public RowCursor(DataFrame dataFrame, bool[] activeColumns) + { + Debug.Assert(dataFrame != null); + Debug.Assert(activeColumns != null); + + _position = -1; + _dataFrame = dataFrame; + _getters = new Delegate[Schema.Count]; + for (int i = 0; i < _getters.Length; i++) + { + if (!activeColumns[i]) + continue; + _getters[i] = CreateGetterDelegate(i); + Debug.Assert(_getters[i] != null); + } + } + + public override long Position => _position; + public override long Batch => 0; + public override DataViewSchema Schema => _dataFrame.DataViewSchema; + + protected override void Dispose(bool disposing) + { + if (_disposed) + return; + if (disposing) + { + _position = -1; + } + _disposed = true; + base.Dispose(disposing); + } + + private Delegate CreateGetterDelegate(int col) + { + DataFrameColumn column = _dataFrame.Columns[col]; + return column.GetDataViewGetter(this); + } + + public override ValueGetter GetGetter(DataViewSchema.Column column) + { + if (!IsColumnActive(column)) + throw new ArgumentOutOfRangeException(nameof(column)); + + return (ValueGetter)_getters[column.Index]; + } + + public override ValueGetter GetIdGetter() + { + return (ref DataViewRowId value) => value = new DataViewRowId((ulong)_position, 0); + } + + public override bool IsColumnActive(DataViewSchema.Column column) + { + return _getters[column.Index] != null; + } + + public override bool MoveNext() + { + if (_disposed) + return false; + _position++; + return _position < _dataFrame.Rows.Count; + } + } + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.IO.cs b/src/Microsoft.Data.Analysis/DataFrame.IO.cs new file mode 100644 index 0000000000..eff4c3a90b --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.IO.cs @@ -0,0 +1,494 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class DataFrame + { + private const int DefaultStreamReaderBufferSize = 1024; + + private static Type GuessKind(int col, List read) + { + Type res = typeof(string); + int nbline = 0; + foreach (var line in read) + { + if (col >= line.Length) + throw new FormatException(string.Format(Strings.LessColumnsThatExpected, nbline + 1)); + + string val = line[col]; + + if (string.Equals(val, "null", StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + if (!string.IsNullOrEmpty(val)) + { + bool boolParse = bool.TryParse(val, out bool boolResult); + if (boolParse) + { + res = DetermineType(nbline == 0, typeof(bool), res); + ++nbline; + continue; + } + bool floatParse = float.TryParse(val, out float floatResult); + if (floatParse) + { + res = DetermineType(nbline == 0, typeof(float), res); + ++nbline; + continue; + } + + res = DetermineType(nbline == 0, typeof(string), res); + ++nbline; + } + } + return res; + } + + private static Type DetermineType(bool first, Type suggested, Type previous) + { + if (first) + return suggested; + else + return MaxKind(suggested, previous); + } + + private static Type MaxKind(Type a, Type b) + { + if (a == typeof(string) || b == typeof(string)) + return typeof(string); + if (a == typeof(float) || b == typeof(float)) + return typeof(float); + if (a == typeof(bool) || b == typeof(bool)) + return typeof(bool); + return typeof(string); + } + + /// + /// Reads a text file as a DataFrame. + /// + /// filename + /// column separator + /// has a header or not + /// column names (can be empty) + /// column types (can be empty) + /// number of rows to read + /// number of rows used to guess types + /// add one column with the row index + /// The character encoding. Defaults to UTF8 if not specified + /// DataFrame + public static DataFrame LoadCsv(string filename, + char separator = ',', bool header = true, + string[] columnNames = null, Type[] dataTypes = null, + int numRows = -1, int guessRows = 10, + bool addIndexColumn = false, Encoding encoding = null) + { + using (Stream fileStream = new FileStream(filename, FileMode.Open)) + { + return LoadCsv(fileStream, + separator: separator, header: header, columnNames: columnNames, dataTypes: dataTypes, numberOfRowsToRead: numRows, + guessRows: guessRows, addIndexColumn: addIndexColumn, encoding: encoding); + } + } + + private static string GetColumnName(string[] columnNames, int columnIndex) + { + return columnNames == null ? "Column" + columnIndex.ToString() : columnNames[columnIndex]; + } + + private static DataFrameColumn CreateColumn(Type kind, string[] columnNames, int columnIndex) + { + DataFrameColumn ret; + if (kind == typeof(bool)) + { + ret = new BooleanDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(int)) + { + ret = new Int32DataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(float)) + { + ret = new SingleDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(string)) + { + ret = new StringDataFrameColumn(GetColumnName(columnNames, columnIndex), 0); + } + else if (kind == typeof(long)) + { + ret = new Int64DataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(decimal)) + { + ret = new DecimalDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(byte)) + { + ret = new ByteDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(char)) + { + ret = new CharDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(double)) + { + ret = new DoubleDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(sbyte)) + { + ret = new SByteDataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(short)) + { + ret = new Int16DataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(uint)) + { + ret = new UInt32DataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(ulong)) + { + ret = new UInt64DataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else if (kind == typeof(ushort)) + { + ret = new UInt16DataFrameColumn(GetColumnName(columnNames, columnIndex)); + } + else + { + throw new NotSupportedException(nameof(kind)); + } + return ret; + } + + private static DataFrame ReadCsvLinesIntoDataFrame(IEnumerable lines, + char separator = ',', bool header = true, + string[] columnNames = null, Type[] dataTypes = null, + long numberOfRowsToRead = -1, int guessRows = 10, bool addIndexColumn = false + ) + { + if (dataTypes == null && guessRows <= 0) + { + throw new ArgumentException(string.Format(Strings.ExpectedEitherGuessRowsOrDataTypes, nameof(guessRows), nameof(dataTypes))); + } + + var linesForGuessType = new List(); + long rowline = 0; + int numberOfColumns = dataTypes?.Length ?? 0; + + if (header == true && numberOfRowsToRead != -1) + { + numberOfRowsToRead++; + } + + List columns; + // First pass: schema and number of rows. + string line = null; + + var enumerator = lines.GetEnumerator(); + while (enumerator.MoveNext()) + { + line = enumerator.Current; + if ((numberOfRowsToRead == -1) || rowline < numberOfRowsToRead) + { + if (linesForGuessType.Count < guessRows || (header && rowline == 0)) + { + var spl = line.Split(separator); + if (header && rowline == 0) + { + if (columnNames == null) + { + columnNames = spl; + } + } + else + { + linesForGuessType.Add(spl); + numberOfColumns = Math.Max(numberOfColumns, spl.Length); + } + } + } + ++rowline; + if (rowline == guessRows || guessRows == 0) + { + break; + } + } + + if (rowline == 0) + { + throw new FormatException(Strings.EmptyFile); + } + + columns = new List(numberOfColumns); + // Guesses types or looks up dataTypes and adds columns. + for (int i = 0; i < numberOfColumns; ++i) + { + Type kind = dataTypes == null ? GuessKind(i, linesForGuessType) : dataTypes[i]; + columns.Add(CreateColumn(kind, columnNames, i)); + } + + DataFrame ret = new DataFrame(columns); + line = null; + + // Fill values. + enumerator.Reset(); + rowline = 0; + while (enumerator.MoveNext() && (numberOfRowsToRead == -1 || rowline < numberOfRowsToRead)) + { + line = enumerator.Current; + var spl = line.Split(separator); + if (header && rowline == 0) + { + // Skips. + } + else + { + ret.Append(spl, inPlace: true); + } + ++rowline; + } + + if (addIndexColumn) + { + PrimitiveDataFrameColumn indexColumn = new PrimitiveDataFrameColumn("IndexColumn", columns[0].Length); + for (int i = 0; i < columns[0].Length; i++) + { + indexColumn[i] = i; + } + columns.Insert(0, indexColumn); + } + return ret; + } + + private class CsvLines : IEnumerable + { + private CsvLineEnumerator enumerator; + public CsvLines(CsvLineEnumerator csvLineEnumerator) + { + enumerator = csvLineEnumerator; + } + + public IEnumerator GetEnumerator() => enumerator; + + IEnumerator IEnumerable.GetEnumerator() => enumerator; + } + + private class CsvLineEnumerator : IEnumerator + { + private StreamReader streamReader; + private string currentLine; + private long streamStartPosition; + public CsvLineEnumerator(StreamReader csvStream) + { + streamStartPosition = csvStream.BaseStream.Position; + streamReader = csvStream; + currentLine = null; + } + + public string Current => currentLine; + + object IEnumerator.Current => currentLine; + + public void Dispose() + { + throw new NotImplementedException(); + } + + public bool MoveNext() + { + currentLine = streamReader.ReadLine(); + return currentLine != null; + } + + public void Reset() + { + streamReader.DiscardBufferedData(); + streamReader.BaseStream.Seek(streamStartPosition, SeekOrigin.Begin); + } + } + + /// + /// Reads CSV data passed in as a string into a DataFrame. + /// + /// csv data passed in as a string + /// column separator + /// has a header or not + /// column names (can be empty) + /// column types (can be empty) + /// number of rows to read not including the header(if present) + /// number of rows used to guess types + /// add one column with the row index + /// + public static DataFrame LoadCsvFromString(string csvString, + char separator = ',', bool header = true, + string[] columnNames = null, Type[] dataTypes = null, + long numberOfRowsToRead = -1, int guessRows = 10, bool addIndexColumn = false) + { + string[] lines = csvString.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + return ReadCsvLinesIntoDataFrame(lines, separator, header, columnNames, dataTypes, numberOfRowsToRead, guessRows, addIndexColumn); + } + + /// + /// Reads a seekable stream of CSV data into a DataFrame. + /// + /// stream of CSV data to be read in + /// column separator + /// has a header or not + /// column names (can be empty) + /// column types (can be empty) + /// number of rows to read not including the header(if present) + /// number of rows used to guess types + /// add one column with the row index + /// The character encoding. Defaults to UTF8 if not specified + /// + public static DataFrame LoadCsv(Stream csvStream, + char separator = ',', bool header = true, + string[] columnNames = null, Type[] dataTypes = null, + long numberOfRowsToRead = -1, int guessRows = 10, bool addIndexColumn = false, + Encoding encoding = null) + { + if (!csvStream.CanSeek) + { + throw new ArgumentException(Strings.NonSeekableStream, nameof(csvStream)); + } + + if (dataTypes == null && guessRows <= 0) + { + throw new ArgumentException(string.Format(Strings.ExpectedEitherGuessRowsOrDataTypes, nameof(guessRows), nameof(dataTypes))); + } + + using (var streamReader = new StreamReader(csvStream, encoding ?? Encoding.UTF8, detectEncodingFromByteOrderMarks: true, DefaultStreamReaderBufferSize, leaveOpen: true)) + { + CsvLineEnumerator linesEnumerator = new CsvLineEnumerator(streamReader); + IEnumerable lines = new CsvLines(linesEnumerator); + return ReadCsvLinesIntoDataFrame(lines, separator, header, columnNames, dataTypes, numberOfRowsToRead, guessRows, addIndexColumn); + } + } + + /// + /// Writes a DataFrame into a CSV. + /// + /// + /// CSV file path + /// column separator + /// has a header or not + /// The character encoding. Defaults to UTF8 if not specified + /// culture info for formatting values + public static void WriteCsv(DataFrame dataFrame, string path, + char separator = ',', bool header = true, + Encoding encoding = null, CultureInfo cultureInfo = null) + { + using (FileStream csvStream = new FileStream(path, FileMode.Create)) + { + WriteCsv(dataFrame: dataFrame, csvStream: csvStream, + separator: separator, header: header, + encoding: encoding, cultureInfo: cultureInfo); + } + } + + /// + /// Writes a DataFrame into a CSV. + /// + /// + /// stream of CSV data to be write out + /// column separator + /// has a header or not + /// the character encoding. Defaults to UTF8 if not specified + /// culture info for formatting values + public static void WriteCsv(DataFrame dataFrame, Stream csvStream, + char separator = ',', bool header = true, + Encoding encoding = null, CultureInfo cultureInfo = null) + { + if (cultureInfo is null) + { + cultureInfo = CultureInfo.CurrentCulture; + } + + if (cultureInfo.NumberFormat.NumberDecimalSeparator.Equals(separator.ToString())) + { + throw new ArgumentException("Decimal separator cannot match the column separator"); + } + + if (encoding is null) + { + encoding = Encoding.ASCII; + } + + using (StreamWriter csvFile = new StreamWriter(csvStream, encoding, bufferSize: DefaultStreamReaderBufferSize, leaveOpen: true)) + { + if (dataFrame != null) + { + var columnNames = dataFrame.Columns.GetColumnNames(); + + if (header) + { + var headerColumns = string.Join(separator.ToString(), columnNames); + csvFile.WriteLine(headerColumns); + } + + var record = new StringBuilder(); + + foreach (var row in dataFrame.Rows) + { + bool firstRow = true; + foreach (var cell in row) + { + if (!firstRow) + { + record.Append(separator); + } + else + { + firstRow = false; + } + + Type t = cell?.GetType(); + + if (t == typeof(bool)) + { + record.AppendFormat(cultureInfo, "{0}", cell); + continue; + } + + if (t == typeof(float)) + { + record.AppendFormat(cultureInfo, "{0:G9}", cell); + continue; + } + + if (t == typeof(double)) + { + record.AppendFormat(cultureInfo, "{0:G17}", cell); + continue; + } + + if (t == typeof(decimal)) + { + record.AppendFormat(cultureInfo, "{0:G31}", cell); + continue; + } + + record.Append(cell); + } + + csvFile.WriteLine(record); + + record.Clear(); + } + } + } + } + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.Join.cs b/src/Microsoft.Data.Analysis/DataFrame.Join.cs new file mode 100644 index 0000000000..d5a1278371 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.Join.cs @@ -0,0 +1,369 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public enum JoinAlgorithm + { + Left, + Right, + FullOuter, + Inner + } + + /// + /// A DataFrame to support indexing, binary operations, sorting, selection and other APIs. This will eventually also expose an IDataView for ML.NET + /// + public partial class DataFrame + { + + private void SetSuffixForDuplicatedColumnNames(DataFrame dataFrame, DataFrameColumn column, string leftSuffix, string rightSuffix) + { + int index = dataFrame._columnCollection.IndexOf(column.Name); + while (index != -1) + { + // Pre-existing column. Change name + DataFrameColumn existingColumn = dataFrame.Columns[index]; + dataFrame._columnCollection.SetColumnName(existingColumn, existingColumn.Name + leftSuffix); + column.SetName(column.Name + rightSuffix); + index = dataFrame._columnCollection.IndexOf(column.Name); + } + } + + /// + /// Joins columns of another + /// + /// The other to join. + /// The suffix to add to this 's column if there are common column names + /// The suffix to add to the 's column if there are common column names + /// The to use. + /// A new + public DataFrame Join(DataFrame other, string leftSuffix = "_left", string rightSuffix = "_right", JoinAlgorithm joinAlgorithm = JoinAlgorithm.Left) + { + DataFrame ret = new DataFrame(); + if (joinAlgorithm == JoinAlgorithm.Left) + { + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn newColumn = Columns[i].Clone(); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + long minLength = Math.Min(Rows.Count, other.Rows.Count); + PrimitiveDataFrameColumn mapIndices = new PrimitiveDataFrameColumn("mapIndices", minLength); + for (long i = 0; i < minLength; i++) + { + mapIndices[i] = i; + } + for (int i = 0; i < other.Columns.Count; i++) + { + DataFrameColumn newColumn; + if (other.Rows.Count < Rows.Count) + { + newColumn = other.Columns[i].Clone(numberOfNullsToAppend: Rows.Count - other.Rows.Count); + } + else + { + newColumn = other.Columns[i].Clone(mapIndices); + } + SetSuffixForDuplicatedColumnNames(ret, newColumn, leftSuffix, rightSuffix); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + } + else if (joinAlgorithm == JoinAlgorithm.Right) + { + long minLength = Math.Min(Rows.Count, other.Rows.Count); + PrimitiveDataFrameColumn mapIndices = new PrimitiveDataFrameColumn("mapIndices", minLength); + for (long i = 0; i < minLength; i++) + { + mapIndices[i] = i; + } + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn newColumn; + if (Rows.Count < other.Rows.Count) + { + newColumn = Columns[i].Clone(numberOfNullsToAppend: other.Rows.Count - Rows.Count); + } + else + { + newColumn = Columns[i].Clone(mapIndices); + } + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + for (int i = 0; i < other.Columns.Count; i++) + { + DataFrameColumn newColumn = other.Columns[i].Clone(); + SetSuffixForDuplicatedColumnNames(ret, newColumn, leftSuffix, rightSuffix); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + } + else if (joinAlgorithm == JoinAlgorithm.FullOuter) + { + long newRowCount = Math.Max(Rows.Count, other.Rows.Count); + long numberOfNulls = newRowCount - Rows.Count; + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn newColumn = Columns[i].Clone(numberOfNullsToAppend: numberOfNulls); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + numberOfNulls = newRowCount - other.Rows.Count; + for (int i = 0; i < other.Columns.Count; i++) + { + DataFrameColumn newColumn = other.Columns[i].Clone(numberOfNullsToAppend: numberOfNulls); + SetSuffixForDuplicatedColumnNames(ret, newColumn, leftSuffix, rightSuffix); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + } + else if (joinAlgorithm == JoinAlgorithm.Inner) + { + long newRowCount = Math.Min(Rows.Count, other.Rows.Count); + PrimitiveDataFrameColumn mapIndices = new PrimitiveDataFrameColumn("mapIndices", newRowCount); + for (long i = 0; i < newRowCount; i++) + { + mapIndices[i] = i; + } + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn newColumn = Columns[i].Clone(mapIndices); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + for (int i = 0; i < other.Columns.Count; i++) + { + DataFrameColumn newColumn = other.Columns[i].Clone(mapIndices); + SetSuffixForDuplicatedColumnNames(ret, newColumn, leftSuffix, rightSuffix); + ret.Columns.Insert(ret.Columns.Count, newColumn); + } + } + return ret; + } + + // TODO: Merge API with an "On" parameter that merges on a column common to 2 dataframes + + /// + /// Merge DataFrames with a database style join + /// + /// + /// + /// + /// + /// + /// + /// + public DataFrame Merge(DataFrame other, string leftJoinColumn, string rightJoinColumn, string leftSuffix = "_left", string rightSuffix = "_right", JoinAlgorithm joinAlgorithm = JoinAlgorithm.Left) + { + // A simple hash join + DataFrame ret = new DataFrame(); + DataFrame leftDataFrame = this; + DataFrame rightDataFrame = other; + + // The final table size is not known until runtime + long rowNumber = 0; + PrimitiveDataFrameColumn leftRowIndices = new PrimitiveDataFrameColumn("LeftIndices"); + PrimitiveDataFrameColumn rightRowIndices = new PrimitiveDataFrameColumn("RightIndices"); + if (joinAlgorithm == JoinAlgorithm.Left) + { + // First hash other dataframe on the rightJoinColumn + DataFrameColumn otherColumn = other.Columns[rightJoinColumn]; + Dictionary> multimap = otherColumn.GroupColumnValues(); + + // Go over the records in this dataframe and match with the dictionary + DataFrameColumn thisColumn = Columns[leftJoinColumn]; + + for (long i = 0; i < thisColumn.Length; i++) + { + var thisColumnValue = thisColumn[i]; + TKey thisColumnValueOrDefault = (TKey)(thisColumnValue == null ? default(TKey) : thisColumnValue); + if (multimap.TryGetValue(thisColumnValueOrDefault, out ICollection rowNumbers)) + { + foreach (long row in rowNumbers) + { + if (thisColumnValue == null) + { + // Match only with nulls in otherColumn + if (otherColumn[row] == null) + { + leftRowIndices.Append(i); + rightRowIndices.Append(row); + } + } + else + { + // Cannot match nulls in otherColumn + if (otherColumn[row] != null) + { + leftRowIndices.Append(i); + rightRowIndices.Append(row); + } + } + } + } + else + { + leftRowIndices.Append(i); + rightRowIndices.Append(null); + } + } + } + else if (joinAlgorithm == JoinAlgorithm.Right) + { + DataFrameColumn thisColumn = Columns[leftJoinColumn]; + Dictionary> multimap = thisColumn.GroupColumnValues(); + + DataFrameColumn otherColumn = other.Columns[rightJoinColumn]; + for (long i = 0; i < otherColumn.Length; i++) + { + var otherColumnValue = otherColumn[i]; + TKey otherColumnValueOrDefault = (TKey)(otherColumnValue == null ? default(TKey) : otherColumnValue); + if (multimap.TryGetValue(otherColumnValueOrDefault, out ICollection rowNumbers)) + { + foreach (long row in rowNumbers) + { + if (otherColumnValue == null) + { + if (thisColumn[row] == null) + { + leftRowIndices.Append(row); + rightRowIndices.Append(i); + } + } + else + { + if (thisColumn[row] != null) + { + leftRowIndices.Append(row); + rightRowIndices.Append(i); + } + } + } + } + else + { + leftRowIndices.Append(null); + rightRowIndices.Append(i); + } + } + } + else if (joinAlgorithm == JoinAlgorithm.Inner) + { + // Hash the column with the smaller RowCount + long leftRowCount = Rows.Count; + long rightRowCount = other.Rows.Count; + DataFrame longerDataFrame = leftRowCount <= rightRowCount ? other : this; + DataFrame shorterDataFrame = ReferenceEquals(longerDataFrame, this) ? other : this; + DataFrameColumn hashColumn = (leftRowCount <= rightRowCount) ? Columns[leftJoinColumn] : other.Columns[rightJoinColumn]; + DataFrameColumn otherColumn = ReferenceEquals(hashColumn, Columns[leftJoinColumn]) ? other.Columns[rightJoinColumn] : Columns[leftJoinColumn]; + Dictionary> multimap = hashColumn.GroupColumnValues(); + + for (long i = 0; i < otherColumn.Length; i++) + { + var otherColumnValue = otherColumn[i]; + TKey otherColumnValueOrDefault = (TKey)(otherColumnValue == null ? default(TKey) : otherColumnValue); + if (multimap.TryGetValue(otherColumnValueOrDefault, out ICollection rowNumbers)) + { + foreach (long row in rowNumbers) + { + if (otherColumnValue == null) + { + if (hashColumn[row] == null) + { + leftRowIndices.Append(row); + rightRowIndices.Append(i); + } + } + else + { + if (hashColumn[row] != null) + { + leftRowIndices.Append(row); + rightRowIndices.Append(i); + } + } + } + } + } + leftDataFrame = shorterDataFrame; + rightDataFrame = longerDataFrame; + } + else if (joinAlgorithm == JoinAlgorithm.FullOuter) + { + DataFrameColumn otherColumn = other.Columns[rightJoinColumn]; + Dictionary> multimap = otherColumn.GroupColumnValues(); + Dictionary intersection = new Dictionary(EqualityComparer.Default); + + // Go over the records in this dataframe and match with the dictionary + DataFrameColumn thisColumn = Columns[leftJoinColumn]; + + for (long i = 0; i < thisColumn.Length; i++) + { + var thisColumnValue = thisColumn[i]; + TKey thisColumnValueOrDefault = (TKey)(thisColumnValue == null ? default(TKey) : thisColumnValue); + if (multimap.TryGetValue(thisColumnValueOrDefault, out ICollection rowNumbers)) + { + foreach (long row in rowNumbers) + { + if (thisColumnValue == null) + { + // Has to match only with nulls in otherColumn + if (otherColumn[row] == null) + { + leftRowIndices.Append(i); + rightRowIndices.Append(row); + if (!intersection.ContainsKey(thisColumnValueOrDefault)) + { + intersection.Add(thisColumnValueOrDefault, rowNumber); + } + } + } + else + { + // Cannot match to nulls in otherColumn + if (otherColumn[row] != null) + { + leftRowIndices.Append(i); + rightRowIndices.Append(row); + if (!intersection.ContainsKey(thisColumnValueOrDefault)) + { + intersection.Add(thisColumnValueOrDefault, rowNumber); + } + } + } + } + } + else + { + leftRowIndices.Append(i); + rightRowIndices.Append(null); + } + } + for (long i = 0; i < otherColumn.Length; i++) + { + TKey value = (TKey)(otherColumn[i] ?? default(TKey)); + if (!intersection.ContainsKey(value)) + { + leftRowIndices.Append(null); + rightRowIndices.Append(i); + } + } + } + else + throw new NotImplementedException(nameof(joinAlgorithm)); + + for (int i = 0; i < leftDataFrame.Columns.Count; i++) + { + ret.Columns.Insert(i, leftDataFrame.Columns[i].Clone(leftRowIndices)); + } + for (int i = 0; i < rightDataFrame.Columns.Count; i++) + { + DataFrameColumn column = rightDataFrame.Columns[i].Clone(rightRowIndices); + SetSuffixForDuplicatedColumnNames(ret, column, leftSuffix, rightSuffix); + ret.Columns.Insert(ret.Columns.Count, column); + } + return ret; + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrame.cs b/src/Microsoft.Data.Analysis/DataFrame.cs new file mode 100644 index 0000000000..39f4865b4d --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrame.cs @@ -0,0 +1,668 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + + /// + /// Options for DropNull(). + /// + public enum DropNullOptions + { + /// + /// "Any" drops a row if any of the row values are null. + /// + Any, + /// + /// "All" drops a row when all of the row values are null. + /// + All + } + + /// + /// A DataFrame to support indexing, binary operations, sorting, selection and other APIs. This will eventually also expose an IDataView for ML.NET + /// + public partial class DataFrame + { + private readonly DataFrameColumnCollection _columnCollection; + private readonly DataFrameRowCollection _rowCollection; + + /// + /// Constructs a with . + /// + /// The columns of this . + public DataFrame(IEnumerable columns) + { + _columnCollection = new DataFrameColumnCollection(columns, OnColumnsChanged); + _rowCollection = new DataFrameRowCollection(this); + } + + public DataFrame(params DataFrameColumn[] columns) + { + _columnCollection = new DataFrameColumnCollection(columns, OnColumnsChanged); + _rowCollection = new DataFrameRowCollection(this); + } + + /// + /// Returns the columns contained in the as a + /// + public DataFrameColumnCollection Columns => _columnCollection; + + /// + /// Returns a that contains a view of the rows in this + /// + public DataFrameRowCollection Rows => _rowCollection; + + internal IReadOnlyList GetColumnNames() => _columnCollection.GetColumnNames(); + + #region Operators + /// + /// An Indexer to get or set values. + /// + /// Zero based row index + /// Zero based column index + /// The value stored at the intersection of and + public object this[long rowIndex, int columnIndex] + { + get => _columnCollection[columnIndex][rowIndex]; + set => _columnCollection[columnIndex][rowIndex] = value; + } + + /// + /// Returns a new DataFrame using the boolean values in + /// + /// A column of booleans + public DataFrame Filter(PrimitiveDataFrameColumn filter) => Clone(filter); + + /// + /// Returns a new DataFrame using the row indices in + /// + /// A column of row indices + public DataFrame Filter(PrimitiveDataFrameColumn rowIndices) => Clone(rowIndices); + + /// + /// Returns a new DataFrame using the row indices in + /// + /// A column of row indices + public DataFrame Filter(PrimitiveDataFrameColumn rowIndices) => Clone(rowIndices); + + /// + /// Returns a new DataFrame using the boolean values in filter + /// + /// A column of booleans + public DataFrame this[PrimitiveDataFrameColumn rowFilter] => Filter(rowFilter); + + /// + /// Returns a new DataFrame using the row indices in + /// + /// A column of row indices + public DataFrame this[PrimitiveDataFrameColumn rowIndices] => Filter(rowIndices); + + /// + /// Returns a new DataFrame using the row indices in + /// + /// A column of row indices + public DataFrame this[PrimitiveDataFrameColumn rowIndices] => Filter(rowIndices); + + /// + /// Returns a new DataFrame using the row indices in + /// + public DataFrame this[IEnumerable rowIndices] + { + get + { + PrimitiveDataFrameColumn filterColumn = new PrimitiveDataFrameColumn("Filter", rowIndices); + return Clone(filterColumn); + } + } + + /// + /// Returns a new DataFrame using the row indices in + /// + public DataFrame this[IEnumerable rowIndices] + { + get + { + PrimitiveDataFrameColumn filterColumn = new PrimitiveDataFrameColumn("Filter", rowIndices); + return Clone(filterColumn); + } + } + + /// + /// Returns a new DataFrame using the boolean values in + /// + public DataFrame this[IEnumerable rowFilter] + { + get + { + PrimitiveDataFrameColumn filterColumn = new PrimitiveDataFrameColumn("Filter", rowFilter); + return Clone(filterColumn); + } + } + + /// + /// An indexer based on + /// + /// The name of a + /// A if it exists. + /// Throws if is not present in this + public DataFrameColumn this[string columnName] + { + get => Columns[columnName]; + set => Columns[columnName] = value; + } + + /// + /// Returns the first rows + /// + /// + public DataFrame Head(int numberOfRows) + { + return Clone(new PrimitiveDataFrameColumn("Filter", Enumerable.Range(0, numberOfRows))); + } + + /// + /// Returns the last rows + /// + /// + public DataFrame Tail(int numberOfRows) + { + PrimitiveDataFrameColumn filter = new PrimitiveDataFrameColumn("Filter", numberOfRows); + for (long i = Rows.Count - numberOfRows; i < Rows.Count; i++) + { + filter[i - (Rows.Count - numberOfRows)] = i; + } + return Clone(filter); + } + // TODO: Add strongly typed versions of these APIs + #endregion + + /// + /// Returns a full copy + /// + public DataFrame Clone() + { + return Clone(mapIndices: null, invertMapIndices: false); + } + + private DataFrame Clone(DataFrameColumn mapIndices = null, bool invertMapIndices = false) + { + List newColumns = new List(Columns.Count); + for (int i = 0; i < Columns.Count; i++) + { + newColumns.Add(Columns[i].Clone(mapIndices, invertMapIndices)); + } + return new DataFrame(newColumns); + } + + /// + /// Generates a concise summary of each column in the DataFrame + /// + public DataFrame Info() + { + DataFrame ret = new DataFrame(); + + bool firstColumn = true; + foreach (DataFrameColumn column in Columns) + { + if (firstColumn) + { + firstColumn = false; + StringDataFrameColumn strColumn = new StringDataFrameColumn("Info", 2); + strColumn[0] = Strings.DataType; + strColumn[1] = Strings.DescriptionMethodLength; + ret.Columns.Add(strColumn); + } + ret.Columns.Add(column.Info()); + } + return ret; + } + + /// + /// Generates descriptive statistics that summarize each numeric column + /// + public DataFrame Description() + { + DataFrame ret = new DataFrame(); + + bool firstDescriptionColumn = true; + foreach (DataFrameColumn column in Columns) + { + if (!column.HasDescription()) + { + continue; + } + if (firstDescriptionColumn) + { + firstDescriptionColumn = false; + StringDataFrameColumn stringColumn = new StringDataFrameColumn("Description", 0); + stringColumn.Append(Strings.DescriptionMethodLength); + stringColumn.Append("Max"); + stringColumn.Append("Min"); + stringColumn.Append("Mean"); + ret.Columns.Add(stringColumn); + } + ret.Columns.Add(column.Description()); + } + return ret; + } + + /// + /// Orders the data frame by a specified column. + /// + /// The column name to order by + public DataFrame OrderBy(string columnName) + { + return Sort(columnName, isAscending: true); + } + + /// + /// Orders the data frame by a specified column in descending order. + /// + /// The column name to order by + public DataFrame OrderByDescending(string columnName) + { + return Sort(columnName, isAscending: false); + } + + /// + /// Clamps values beyond the specified thresholds on numeric columns + /// + /// + /// Minimum value. All values below this threshold will be set to it + /// Maximum value. All values above this threshold will be set to it + /// Indicates if the operation should be performed in place + public DataFrame Clamp(U min, U max, bool inPlace = false) + { + DataFrame ret = inPlace ? this : Clone(); + + for (int i = 0; i < ret.Columns.Count; i++) + { + DataFrameColumn column = ret.Columns[i]; + if (column.IsNumericColumn()) + column.Clamp(min, max, inPlace: true); + } + return ret; + } + + /// + /// Adds a prefix to the column names + /// + public DataFrame AddPrefix(string prefix, bool inPlace = false) + { + DataFrame df = inPlace ? this : Clone(); + for (int i = 0; i < df.Columns.Count; i++) + { + DataFrameColumn column = df.Columns[i]; + df._columnCollection.SetColumnName(column, prefix + column.Name); + df.OnColumnsChanged(); + } + return df; + } + + /// + /// Adds a suffix to the column names + /// + public DataFrame AddSuffix(string suffix, bool inPlace = false) + { + DataFrame df = inPlace ? this : Clone(); + for (int i = 0; i < df.Columns.Count; i++) + { + DataFrameColumn column = df.Columns[i]; + df._columnCollection.SetColumnName(column, column.Name + suffix); + df.OnColumnsChanged(); + } + return df; + } + + /// + /// Returns a random sample of rows + /// + /// Number of rows in the returned DataFrame + public DataFrame Sample(int numberOfRows) + { + if (numberOfRows > Rows.Count) + { + throw new ArgumentException(string.Format(Strings.ExceedsNumberOfRows, Rows.Count), nameof(numberOfRows)); + } + + int shuffleLowerLimit = 0; + int shuffleUpperLimit = (int)Math.Min(Int32.MaxValue, Rows.Count); + + int[] shuffleArray = Enumerable.Range(0, shuffleUpperLimit).ToArray(); + Random rand = new Random(); + while (shuffleLowerLimit < numberOfRows) + { + int randomIndex = rand.Next(shuffleLowerLimit, shuffleUpperLimit); + int temp = shuffleArray[shuffleLowerLimit]; + shuffleArray[shuffleLowerLimit] = shuffleArray[randomIndex]; + shuffleArray[randomIndex] = temp; + shuffleLowerLimit++; + } + ArraySegment segment = new ArraySegment(shuffleArray, 0, shuffleLowerLimit); + + PrimitiveDataFrameColumn indices = new PrimitiveDataFrameColumn("indices", segment); + + return Clone(indices); + } + + /// + /// Groups the rows of the by unique values in the column. + /// + /// The column used to group unique values + /// A GroupBy object that stores the group information. + public GroupBy GroupBy(string columnName) + { + int columnIndex = _columnCollection.IndexOf(columnName); + if (columnIndex == -1) + throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName)); + + DataFrameColumn column = _columnCollection[columnIndex]; + return column.GroupBy(columnIndex, this); + } + + // In GroupBy and ReadCsv calls, columns get resized. We need to set the RowCount to reflect the true Length of the DataFrame. This does internal validation + internal void SetTableRowCount(long rowCount) + { + // Even if current RowCount == rowCount, do the validation + for (int i = 0; i < Columns.Count; i++) + { + if (Columns[i].Length != rowCount) + throw new ArgumentException(String.Format("{0} {1}", Strings.MismatchedRowCount, Columns[i].Name)); + } + _columnCollection.RowCount = rowCount; + } + + /// + /// Returns a DataFrame with no missing values + /// + /// + public DataFrame DropNulls(DropNullOptions options = DropNullOptions.Any) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn filter = new PrimitiveDataFrameColumn("Filter"); + if (options == DropNullOptions.Any) + { + filter.AppendMany(true, Rows.Count); + + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn column = Columns[i]; + filter.ApplyElementwise((bool? value, long index) => + { + return value.Value && (column[index] == null ? false : true); + }); + } + } + else + { + filter.AppendMany(false, Rows.Count); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn column = Columns[i]; + filter.ApplyElementwise((bool? value, long index) => + { + return value.Value || (column[index] == null ? false : true); + }); + } + } + return this[filter]; + } + + /// + /// Fills values with . + /// + /// The value to replace with. + /// A boolean flag to indicate if the operation should be in place + /// A new if is not set. Returns this otherwise. + public DataFrame FillNulls(object value, bool inPlace = false) + { + DataFrame ret = inPlace ? this : Clone(); + for (int i = 0; i < ret.Columns.Count; i++) + { + ret.Columns[i].FillNulls(value, inPlace: true); + } + return ret; + } + + /// + /// Fills values in each column with values from . + /// + /// The values to replace with, one value per column. Should be equal to the number of columns in this . + /// A boolean flag to indicate if the operation should be in place + /// A new if is not set. Returns this otherwise. + public DataFrame FillNulls(IList values, bool inPlace = false) + { + if (values.Count != Columns.Count) + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(values)); + + DataFrame ret = inPlace ? this : Clone(); + for (int i = 0; i < ret.Columns.Count; i++) + { + Columns[i].FillNulls(values[i], inPlace: true); + } + return ret; + } + + private void ResizeByOneAndAppend(DataFrameColumn column, object value) + { + long length = column.Length; + column.Resize(length + 1); + column[length] = value; + } + + /// + /// Appends rows to the DataFrame + /// + /// If an input column's value doesn't match a DataFrameColumn's data type, a conversion will be attempted + /// If a in is null, a null value is appended to each column + /// The rows to be appended to this DataFrame + /// If set, appends in place. Otherwise, a new DataFrame is returned with the appended + public DataFrame Append(IEnumerable rows, bool inPlace = false) + { + DataFrame ret = inPlace ? this : Clone(); + foreach (DataFrameRow row in rows) + { + ret.Append(row, inPlace: true); + } + return ret; + } + + /// + /// Appends a row to the DataFrame + /// + /// If a column's value doesn't match its column's data type, a conversion will be attempted + /// If is null, a null value is appended to each column + /// + /// If set, appends a in place. Otherwise, a new DataFrame is returned with an appended + public DataFrame Append(IEnumerable row = null, bool inPlace = false) + { + DataFrame ret = inPlace ? this : Clone(); + IEnumerator columnEnumerator = ret.Columns.GetEnumerator(); + bool columnMoveNext = columnEnumerator.MoveNext(); + if (row != null) + { + // Go through row first to make sure there are no data type incompatibilities + IEnumerator rowEnumerator = row.GetEnumerator(); + bool rowMoveNext = rowEnumerator.MoveNext(); + List cachedObjectConversions = new List(); + while (columnMoveNext && rowMoveNext) + { + DataFrameColumn column = columnEnumerator.Current; + object value = rowEnumerator.Current; + // StringDataFrameColumn can accept empty strings. The other columns interpret empty values as nulls + if (value is string stringValue) + { + if (stringValue.Length == 0 && column.DataType != typeof(string)) + { + value = null; + } + else if (stringValue.Equals("null", StringComparison.OrdinalIgnoreCase)) + { + value = null; + } + } + if (value != null) + { + value = Convert.ChangeType(value, column.DataType); + if (value is null) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, column.DataType), value.GetType().ToString()); + } + } + cachedObjectConversions.Add(value); + columnMoveNext = columnEnumerator.MoveNext(); + rowMoveNext = rowEnumerator.MoveNext(); + } + if (rowMoveNext) + { + throw new ArgumentException(string.Format(Strings.ExceedsNumberOfColumns, Columns.Count), nameof(row)); + } + // Reset the enumerators + columnEnumerator = ret.Columns.GetEnumerator(); + columnMoveNext = columnEnumerator.MoveNext(); + rowEnumerator = row.GetEnumerator(); + rowMoveNext = rowEnumerator.MoveNext(); + int cacheIndex = 0; + while (columnMoveNext && rowMoveNext) + { + DataFrameColumn column = columnEnumerator.Current; + object value = cachedObjectConversions[cacheIndex]; + ret.ResizeByOneAndAppend(column, value); + columnMoveNext = columnEnumerator.MoveNext(); + rowMoveNext = rowEnumerator.MoveNext(); + cacheIndex++; + } + } + while (columnMoveNext) + { + // Fill the remaining columns with null + DataFrameColumn column = columnEnumerator.Current; + ret.ResizeByOneAndAppend(column, null); + columnMoveNext = columnEnumerator.MoveNext(); + } + ret.Columns.RowCount++; + return ret; + } + + /// + /// Appends a row by enumerating column names and values from + /// + /// If a column's value doesn't match its column's data type, a conversion will be attempted + /// An enumeration of column name and value to be appended + /// If set, appends in place. Otherwise, a new DataFrame is returned with an appended + public DataFrame Append(IEnumerable> row, bool inPlace = false) + { + DataFrame ret = inPlace ? this : Clone(); + if (row == null) + { + throw new ArgumentNullException(nameof(row)); + } + + List cachedObjectConversions = new List(); + foreach (KeyValuePair columnAndValue in row) + { + string columnName = columnAndValue.Key; + int index = ret.Columns.IndexOf(columnName); + if (index == -1) + { + throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName)); + } + + DataFrameColumn column = ret.Columns[index]; + object value = columnAndValue.Value; + if (value != null) + { + value = Convert.ChangeType(value, column.DataType); + if (value is null) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, column.DataType), value.GetType().ToString()); + } + } + cachedObjectConversions.Add(value); + } + + int cacheIndex = 0; + foreach (KeyValuePair columnAndValue in row) + { + string columnName = columnAndValue.Key; + int index = ret.Columns.IndexOf(columnName); + + DataFrameColumn column = ret.Columns[index]; + object value = cachedObjectConversions[cacheIndex]; + ret.ResizeByOneAndAppend(column, value); + cacheIndex++; + } + + foreach (DataFrameColumn column in ret.Columns) + { + if (column.Length == Rows.Count) + { + ret.ResizeByOneAndAppend(column, null); + } + } + ret.Columns.RowCount++; + return ret; + } + + /// + /// Invalidates any cached data after a column has changed. + /// + private void OnColumnsChanged() + { + _schema = null; + } + + private DataFrame Sort(string columnName, bool isAscending) + { + DataFrameColumn column = Columns[columnName]; + DataFrameColumn sortIndices = column.GetAscendingSortIndices(); + List newColumns = new List(Columns.Count); + for (int i = 0; i < Columns.Count; i++) + { + DataFrameColumn oldColumn = Columns[i]; + DataFrameColumn newColumn = oldColumn.Clone(sortIndices, !isAscending, oldColumn.NullCount); + Debug.Assert(newColumn.NullCount == oldColumn.NullCount); + newColumns.Add(newColumn); + } + return new DataFrame(newColumns); + } + + /// + /// A preview of the contents of this as a string. + /// + /// A preview of the contents of this . + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + int longestColumnName = 0; + for (int i = 0; i < Columns.Count; i++) + { + longestColumnName = Math.Max(longestColumnName, Columns[i].Name.Length); + } + for (int i = 0; i < Columns.Count; i++) + { + // Left align by 10 + sb.Append(string.Format(Columns[i].Name.PadRight(longestColumnName))); + } + sb.AppendLine(); + long numberOfRows = Math.Min(Rows.Count, 25); + for (int i = 0; i < numberOfRows; i++) + { + foreach (object obj in Rows[i]) + { + sb.Append((obj ?? "null").ToString().PadRight(longestColumnName)); + } + sb.AppendLine(); + } + return sb.ToString(); + } + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameBuffer.cs b/src/Microsoft.Data.Analysis/DataFrameBuffer.cs new file mode 100644 index 0000000000..44a8d3faaa --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameBuffer.cs @@ -0,0 +1,97 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Microsoft.Data.Analysis +{ + /// + /// A basic mutable store to hold values in a DataFrame column. Supports wrapping with an ArrowBuffer + /// + /// + internal class DataFrameBuffer : ReadOnlyDataFrameBuffer + where T : struct + { + private Memory _memory; + + public override ReadOnlyMemory ReadOnlyBuffer => _memory; + + public Memory Buffer + { + get => _memory; + } + + public Span Span + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (MemoryMarshal.Cast(Buffer.Span)).Slice(0, Length); + } + + public Span RawSpan + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => MemoryMarshal.Cast(Buffer.Span); + } + + public DataFrameBuffer(int numberOfValues = 8) : base(numberOfValues) { } + + internal DataFrameBuffer(ReadOnlyMemory buffer, int length) : base(buffer, length) + { + _memory = new byte[buffer.Length]; + buffer.CopyTo(_memory); + } + + public void Append(T value) + { + if (Length == MaxCapacity) + { + throw new ArgumentException("Current buffer is full", nameof(value)); + } + EnsureCapacity(1); + if (Length < MaxCapacity) + ++Length; + Span[Length - 1] = value; + } + + public void EnsureCapacity(int numberOfValues) + { + long newLength = Length + (long)numberOfValues; + if (newLength > MaxCapacity) + { + throw new ArgumentException("Current buffer is full", nameof(numberOfValues)); + } + + if (newLength > Capacity) + { + var newCapacity = Math.Max(newLength * Size, ReadOnlyBuffer.Length * 2); + var memory = new Memory(new byte[newCapacity]); + _memory.CopyTo(memory); + _memory = memory; + } + } + + internal override T this[int index] + { + set + { + if (index > Length) + throw new ArgumentOutOfRangeException(nameof(index)); + RawSpan[index] = value; + } + } + + internal static DataFrameBuffer GetMutableBuffer(ReadOnlyDataFrameBuffer buffer) + { + DataFrameBuffer mutableBuffer = buffer as DataFrameBuffer; + if (mutableBuffer == null) + { + mutableBuffer = new DataFrameBuffer(buffer.ReadOnlyBuffer, buffer.Length); + mutableBuffer.Length = buffer.Length; + } + return mutableBuffer; + } + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.cs b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.cs new file mode 100644 index 0000000000..8ecd052486 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.cs @@ -0,0 +1,320 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public abstract partial class DataFrameColumn + { + /// + /// Performs element-wise addition + /// + public virtual DataFrameColumn Add(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise addition on each value in the column + /// + public virtual DataFrameColumn Add(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise addition on each value in the column + /// + public virtual DataFrameColumn ReverseAdd(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise subtraction + /// + public virtual DataFrameColumn Subtract(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise subtraction on each value in the column + /// + public virtual DataFrameColumn Subtract(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise subtraction on each value in the column + /// + public virtual DataFrameColumn ReverseSubtract(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise multiplication + /// + public virtual DataFrameColumn Multiply(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise multiplication on each value in the column + /// + public virtual DataFrameColumn Multiply(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise multiplication on each value in the column + /// + public virtual DataFrameColumn ReverseMultiply(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise division + /// + public virtual DataFrameColumn Divide(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise division on each value in the column + /// + public virtual DataFrameColumn Divide(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise division on each value in the column + /// + public virtual DataFrameColumn ReverseDivide(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise modulus + /// + public virtual DataFrameColumn Modulo(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise modulus operation on each value in the column + /// + public virtual DataFrameColumn Modulo(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise modulus operation on each value in the column + /// + public virtual DataFrameColumn ReverseModulo(T value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise boolean And + /// + public virtual DataFrameColumn And(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise boolean And on each value in the column + /// + public virtual PrimitiveDataFrameColumn And(bool value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise boolean And on each value in the column + /// + public virtual PrimitiveDataFrameColumn ReverseAnd(bool value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise boolean Or + /// + public virtual DataFrameColumn Or(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise boolean Or on each value in the column + /// + public virtual PrimitiveDataFrameColumn Or(bool value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise boolean Or on each value in the column + /// + public virtual PrimitiveDataFrameColumn ReverseOr(bool value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise boolean Xor + /// + public virtual DataFrameColumn Xor(DataFrameColumn column, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise boolean Xor on each value in the column + /// + public virtual PrimitiveDataFrameColumn Xor(bool value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs a reversed element-wise boolean Xor on each value in the column + /// + public virtual PrimitiveDataFrameColumn ReverseXor(bool value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise left shift on each value in the column + /// + public virtual DataFrameColumn LeftShift(int value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise right shift on each value in the column + /// + public virtual DataFrameColumn RightShift(int value, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise equals + /// + public virtual PrimitiveDataFrameColumn ElementwiseEquals(DataFrameColumn column) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise equals on each value in the column + /// + public virtual PrimitiveDataFrameColumn ElementwiseEquals(T value) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise not-equals + /// + public virtual PrimitiveDataFrameColumn ElementwiseNotEquals(DataFrameColumn column) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise not-equals on each value in the column + /// + public virtual PrimitiveDataFrameColumn ElementwiseNotEquals(T value) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise greater than or equal + /// + public virtual PrimitiveDataFrameColumn ElementwiseGreaterThanOrEqual(DataFrameColumn column) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise greater than or equal on each value in the column + /// + public virtual PrimitiveDataFrameColumn ElementwiseGreaterThanOrEqual(T value) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise less than or equal + /// + public virtual PrimitiveDataFrameColumn ElementwiseLessThanOrEqual(DataFrameColumn column) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise less than or equal on each value in the column + /// + public virtual PrimitiveDataFrameColumn ElementwiseLessThanOrEqual(T value) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise greater than + /// + public virtual PrimitiveDataFrameColumn ElementwiseGreaterThan(DataFrameColumn column) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise greater than on each value in the column + /// + public virtual PrimitiveDataFrameColumn ElementwiseGreaterThan(T value) + { + throw new NotImplementedException(); + } + + /// + /// Performs element-wise less than + /// + public virtual PrimitiveDataFrameColumn ElementwiseLessThan(DataFrameColumn column) + { + throw new NotImplementedException(); + } + + /// + /// Performs an element-wise less than on each value in the column + /// + public virtual PrimitiveDataFrameColumn ElementwiseLessThan(T value) + { + throw new NotImplementedException(); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.tt b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.tt new file mode 100644 index 0000000000..d2e289195c --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperations.tt @@ -0,0 +1,82 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude"#> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public abstract partial class DataFrameColumn + { +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) { #> +<# if (method.IsBitwise == true) { #> + /// + /// <#=method.GetColumnSpecificMethodComments()#> + /// + public virtual PrimitiveDataFrameColumn <#=method.MethodName#>(bool value, bool inPlace = false) +<# } else { #> + /// + /// <#=method.GetColumnSpecificMethodComments()#> + /// + public virtual DataFrameColumn <#=method.MethodName#>(T value, bool inPlace = false) +<# } #> +<# } #> +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + /// + /// <#=method.GetColumnSpecificMethodComments()#> + /// + public virtual PrimitiveDataFrameColumn <#=method.MethodName#>(T value) +<# } #> +<# if (method.MethodType == MethodType.Binary) {#> + /// + /// <#=method.MethodComments#> + /// + public virtual DataFrameColumn <#=method.MethodName#>(DataFrameColumn column, bool inPlace = false) +<# } #> +<# if (method.MethodType == MethodType.Comparison) {#> + /// + /// <#=method.MethodComments#> + /// + public virtual PrimitiveDataFrameColumn <#=method.MethodName#>(DataFrameColumn column) +<# } #> +<# if (method.MethodType == MethodType.BinaryInt ) {#> + /// + /// <#=method.GetColumnSpecificMethodComments()#> + /// + public virtual DataFrameColumn <#=method.MethodName#>(int value, bool inPlace = false) +<# } #> + { + throw new NotImplementedException(); + } + +<# if (method.MethodType == MethodType.BinaryScalar) { #> +<# if (method.IsBitwise == true) { #> + /// + /// <#=method.GetColumnSpecificReverseMethodComments()#> + /// + public virtual PrimitiveDataFrameColumn Reverse<#=method.MethodName#>(bool value, bool inPlace = false) +<# } else { #> + /// + /// <#=method.GetColumnSpecificReverseMethodComments()#> + /// + public virtual DataFrameColumn Reverse<#=method.MethodName#>(T value, bool inPlace = false) +<# } #> + { + throw new NotImplementedException(); + } + +<# } #> +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperators.cs b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperators.cs new file mode 100644 index 0000000000..6d1515bc5e --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperators.cs @@ -0,0 +1,652 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperators.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public abstract partial class DataFrameColumn + { + #pragma warning disable 1591 + public static DataFrameColumn operator +(DataFrameColumn left, DataFrameColumn right) + { + return left.Add(right); + } + + public static DataFrameColumn operator +(DataFrameColumn column, byte value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(byte value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, decimal value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(decimal value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, double value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(double value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, float value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(float value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, int value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(int value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, long value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(long value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, sbyte value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(sbyte value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, short value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(short value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, uint value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(uint value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, ulong value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(ulong value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + public static DataFrameColumn operator +(DataFrameColumn column, ushort value) + { + return column.Add(value); + } + + public static DataFrameColumn operator +(ushort value, DataFrameColumn column) + { + return column.ReverseAdd(value); + } + + + public static DataFrameColumn operator -(DataFrameColumn left, DataFrameColumn right) + { + return left.Subtract(right); + } + + public static DataFrameColumn operator -(DataFrameColumn column, byte value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(byte value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, decimal value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(decimal value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, double value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(double value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, float value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(float value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, int value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(int value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, long value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(long value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, sbyte value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(sbyte value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, short value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(short value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, uint value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(uint value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, ulong value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(ulong value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + public static DataFrameColumn operator -(DataFrameColumn column, ushort value) + { + return column.Subtract(value); + } + + public static DataFrameColumn operator -(ushort value, DataFrameColumn column) + { + return column.ReverseSubtract(value); + } + + + public static DataFrameColumn operator *(DataFrameColumn left, DataFrameColumn right) + { + return left.Multiply(right); + } + + public static DataFrameColumn operator *(DataFrameColumn column, byte value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(byte value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, decimal value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(decimal value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, double value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(double value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, float value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(float value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, int value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(int value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, long value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(long value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, sbyte value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(sbyte value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, short value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(short value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, uint value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(uint value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, ulong value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(ulong value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + public static DataFrameColumn operator *(DataFrameColumn column, ushort value) + { + return column.Multiply(value); + } + + public static DataFrameColumn operator *(ushort value, DataFrameColumn column) + { + return column.ReverseMultiply(value); + } + + + public static DataFrameColumn operator /(DataFrameColumn left, DataFrameColumn right) + { + return left.Divide(right); + } + + public static DataFrameColumn operator /(DataFrameColumn column, byte value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(byte value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, decimal value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(decimal value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, double value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(double value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, float value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(float value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, int value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(int value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, long value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(long value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, sbyte value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(sbyte value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, short value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(short value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, uint value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(uint value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, ulong value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(ulong value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + public static DataFrameColumn operator /(DataFrameColumn column, ushort value) + { + return column.Divide(value); + } + + public static DataFrameColumn operator /(ushort value, DataFrameColumn column) + { + return column.ReverseDivide(value); + } + + + public static DataFrameColumn operator %(DataFrameColumn left, DataFrameColumn right) + { + return left.Modulo(right); + } + + public static DataFrameColumn operator %(DataFrameColumn column, byte value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(byte value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, decimal value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(decimal value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, double value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(double value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, float value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(float value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, int value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(int value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, long value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(long value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, sbyte value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(sbyte value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, short value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(short value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, uint value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(uint value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, ulong value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(ulong value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + public static DataFrameColumn operator %(DataFrameColumn column, ushort value) + { + return column.Modulo(value); + } + + public static DataFrameColumn operator %(ushort value, DataFrameColumn column) + { + return column.ReverseModulo(value); + } + + + public static DataFrameColumn operator &(DataFrameColumn left, DataFrameColumn right) + { + return left.And(right); + } + + public static DataFrameColumn operator &(DataFrameColumn column, bool value) + { + return column.And(value); + } + + public static DataFrameColumn operator &(bool value, DataFrameColumn column) + { + return column.ReverseAnd(value); + } + + public static DataFrameColumn operator |(DataFrameColumn left, DataFrameColumn right) + { + return left.Or(right); + } + + public static DataFrameColumn operator |(DataFrameColumn column, bool value) + { + return column.Or(value); + } + + public static DataFrameColumn operator |(bool value, DataFrameColumn column) + { + return column.ReverseOr(value); + } + + public static DataFrameColumn operator ^(DataFrameColumn left, DataFrameColumn right) + { + return left.Xor(right); + } + + public static DataFrameColumn operator ^(DataFrameColumn column, bool value) + { + return column.Xor(value); + } + + public static DataFrameColumn operator ^(bool value, DataFrameColumn column) + { + return column.ReverseXor(value); + } + + public static DataFrameColumn operator <<(DataFrameColumn column, int value) + { + return column.LeftShift(value); + } + + public static DataFrameColumn operator >>(DataFrameColumn column, int value) + { + return column.RightShift(value); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperators.tt b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperators.tt new file mode 100644 index 0000000000..aa68fe0d0f --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.BinaryOperators.tt @@ -0,0 +1,67 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperators.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public abstract partial class DataFrameColumn + { + #pragma warning disable 1591 +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) { #> +<# if (method.IsBitwise == true) { #> + public static DataFrameColumn operator <#=method.Operator#>(DataFrameColumn column, bool value) + { + return column.<#=method.MethodName#>(value); + } + + public static DataFrameColumn operator <#=method.Operator#>(bool value, DataFrameColumn column) + { + return column.Reverse<#=method.MethodName#>(value); + } + +<# } else { #> +<# foreach (TypeConfiguration type in typeConfiguration) { #> +<# if (method.IsNumeric != type.SupportsNumeric) continue; #> +<# if (method.IsNumeric && type.TypeName == "char") continue; #> + public static DataFrameColumn operator <#=method.Operator#>(DataFrameColumn column, <#=type.TypeName#> value) + { + return column.<#=method.MethodName#>(value); + } + + public static DataFrameColumn operator <#=method.Operator#>(<#=type.TypeName#> value, DataFrameColumn column) + { + return column.Reverse<#=method.MethodName#>(value); + } + +<# } #> + +<# } #> +<# } else if (method.MethodType == MethodType.BinaryInt) {#> + public static DataFrameColumn operator <#=method.Operator#>(DataFrameColumn column, int value) + { + return column.<#=method.MethodName#>(value); + } + +<# } else if (method.MethodType == MethodType.Binary) { #> + public static DataFrameColumn operator <#=method.Operator#>(DataFrameColumn left, DataFrameColumn right) + { + return left.<#=method.MethodName#>(right); + } + +<# } #> +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.Computations.cs b/src/Microsoft.Data.Analysis/DataFrameColumn.Computations.cs new file mode 100644 index 0000000000..fedfb36325 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.Computations.cs @@ -0,0 +1,176 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.Computations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public abstract partial class DataFrameColumn + { + /// + /// Updates each numeric element with its absolute numeric value + /// + public virtual DataFrameColumn Abs(bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Returns whether all the elements are True + /// + public virtual bool All() + { + throw new NotImplementedException(); + } + + /// + /// Returns whether any element is True + /// + public virtual bool Any() + { + throw new NotImplementedException(); + } + + /// + /// Updates each element with its cumulative maximum + /// + public virtual DataFrameColumn CumulativeMax(bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates column values at rowIndices with its cumulative rowIndices maximum + /// + public virtual DataFrameColumn CumulativeMax(IEnumerable rowIndices, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates each element with its cumulative minimum + /// + public virtual DataFrameColumn CumulativeMin(bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates column values at rowIndices with its cumulative rowIndices minimum + /// + public virtual DataFrameColumn CumulativeMin(IEnumerable rowIndices, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates each element with its cumulative product + /// + public virtual DataFrameColumn CumulativeProduct(bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates column values at rowIndices with its cumulative rowIndices product + /// + public virtual DataFrameColumn CumulativeProduct(IEnumerable rowIndices, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates each element with its cumulative sum + /// + public virtual DataFrameColumn CumulativeSum(bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Updates column values at rowIndices with its cumulative rowIndices sum + /// + public virtual DataFrameColumn CumulativeSum(IEnumerable rowIndices, bool inPlace = false) + { + throw new NotImplementedException(); + } + + /// + /// Returns the maximum of the values in the column + /// + public virtual object Max() + { + throw new NotImplementedException(); + } + + /// + /// Returns the maximum of the values at rowIndices + /// + public virtual object Max(IEnumerable rowIndices) + { + throw new NotImplementedException(); + } + + /// + /// Returns the minimum of the values in the column + /// + public virtual object Min() + { + throw new NotImplementedException(); + } + + /// + /// Returns the minimum of the values at the rowIndices + /// + public virtual object Min(IEnumerable rowIndices) + { + throw new NotImplementedException(); + } + + /// + /// Returns the product of the values in the column + /// + public virtual object Product() + { + throw new NotImplementedException(); + } + + /// + /// Returns the product of the values at the rowIndices + /// + public virtual object Product(IEnumerable rowIndices) + { + throw new NotImplementedException(); + } + + /// + /// Returns the sum of the values in the column + /// + public virtual object Sum() + { + throw new NotImplementedException(); + } + + /// + /// Returns the sum of the values at the rowIndices + /// + public virtual object Sum(IEnumerable rowIndices) + { + throw new NotImplementedException(); + } + + /// + /// Calls Math.Round on each value in a column + /// + public virtual DataFrameColumn Round(bool inPlace = false) + { + throw new NotImplementedException(); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.Computations.tt b/src/Microsoft.Data.Analysis/DataFrameColumn.Computations.tt new file mode 100644 index 0000000000..ebe4785ae7 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.Computations.tt @@ -0,0 +1,44 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude"#> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.Computations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public abstract partial class DataFrameColumn + { +<# foreach (MethodConfiguration compMethod in computationMethodConfiguration) { #> + /// + /// <#=compMethod.MethodComments#> + /// +<# if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false && compMethod.SupportsRowSubsets == true) {#> + public virtual DataFrameColumn <#=compMethod.MethodName#>(IEnumerable rowIndices, bool inPlace = false) +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false) {#> + public virtual DataFrameColumn <#=compMethod.MethodName#>(bool inPlace = false) +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == true) {#> + public virtual object <#=compMethod.MethodName#>() +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true && compMethod.SupportsRowSubsets == true) { #> + public virtual object <#=compMethod.MethodName#>(IEnumerable rowIndices) +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true) { #> + public virtual object <#=compMethod.MethodName#>() +<# } else { #> + public virtual bool <#=compMethod.MethodName#>() +<# } #> + { + throw new NotImplementedException(); + } + +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumn.cs b/src/Microsoft.Data.Analysis/DataFrameColumn.cs new file mode 100644 index 0000000000..c064ed8bda --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumn.cs @@ -0,0 +1,600 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Apache.Arrow; +using Microsoft.ML; + +namespace Microsoft.Data.Analysis +{ + /// + /// The base column type. All APIs should be defined here first + /// + public abstract partial class DataFrameColumn : IEnumerable + { + /// + /// The base constructor. + /// + /// The name of this column. + /// The length of this column. + /// The type of data this column holds. + protected DataFrameColumn(string name, long length, Type type) + { + Length = length; + _name = name; + DataType = type; + } + + /// + /// A static factory method to create a . + /// It allows you to take advantage of type inference based on the type of the values supplied. + /// + /// The type of the column to create. + /// The name of the column. + /// The initial values to populate in the column. + /// A populated with the provided data. + public static PrimitiveDataFrameColumn Create(string name, IEnumerable values) where T : unmanaged + { + return new PrimitiveDataFrameColumn(name, values); + } + + /// + /// A static factory method to create a . + /// It allows you to take advantage of type inference based on the type of the values supplied. + /// + /// The type of the column to create. + /// The name of the column. + /// The initial values to populate in the column. + /// A populated with the provided data. + public static PrimitiveDataFrameColumn Create(string name, IEnumerable values) where T : unmanaged + { + return new PrimitiveDataFrameColumn(name, values); + } + + /// + /// A static factory method to create a . + /// It allows you to take advantage of type inference based on the type of the values supplied. + /// + /// The name of the column. + /// The initial values to populate in the column. + /// A populated with the provided data. + public static StringDataFrameColumn Create(string name, IEnumerable values) + { + return new StringDataFrameColumn(name, values); + } + + private long _length; + + /// + /// The length of this column + /// + public long Length + { + get => _length; + protected set + { + if (value < 0) + throw new ArgumentOutOfRangeException(); + _length = value; + } + } + + /// + /// The number of values in this column. + /// + public abstract long NullCount + { + get; + } + + private string _name; + + /// + /// The name of this column. + /// + public string Name => _name; + + /// + /// Updates the name of this column. + /// + /// The new name. + /// If passed in, update the column name in + public void SetName(string newName, DataFrame dataFrame = null) + { + if (!(dataFrame is null)) + { + dataFrame.Columns.SetColumnName(this, newName); + } + _name = newName; + } + + /// + /// The type of data this column holds. + /// + public Type DataType { get; } + + /// + /// Indexer to get/set values at + /// + /// The index to look up + /// The value at + public object this[long rowIndex] + { + get => GetValue(rowIndex); + set => SetValue(rowIndex, value); + } + + /// + /// Returns the value at . + /// + /// + /// The value at . + protected abstract object GetValue(long rowIndex); + + /// + /// Returns number of values starting from . + /// + /// The first index to return values from. + /// The number of values to return. + /// A read only list of values + protected abstract IReadOnlyList GetValues(long startIndex, int length); + + /// + /// Sets the value at with + /// + /// The row index + /// The new value. + protected abstract void SetValue(long rowIndex, object value); + + /// + /// Returns number of values starting from . + /// + /// The first index to return values from. + /// The number of values to return. + /// A read only list of values + public IReadOnlyList this[long startIndex, int length] + { + get => GetValues(startIndex, length); + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumeratorCore(); + + /// + /// Returns an enumerator that iterates this column. + /// + protected abstract IEnumerator GetEnumeratorCore(); + + /// + /// Called internally from Append, Merge and GroupBy. Resizes the column to the specified length to allow setting values by indexing + /// + /// The new length of the column + protected internal virtual void Resize(long length) => throw new NotImplementedException(); + + /// + /// Clone column to produce a copy potentially changing the order of values by supplying mapIndices and an invert flag + /// + /// + /// + /// + /// A new + public virtual DataFrameColumn Clone(DataFrameColumn mapIndices = null, bool invertMapIndices = false, long numberOfNullsToAppend = 0) => CloneImplementation(mapIndices, invertMapIndices, numberOfNullsToAppend); + + /// + /// Clone column to produce a copy potentially changing the order of values by supplying mapIndices and an invert flag + /// + /// + /// + /// + /// A new + protected virtual DataFrameColumn CloneImplementation(DataFrameColumn mapIndices, bool invertMapIndices, long numberOfNullsToAppend) => throw new NotImplementedException(); + + /// + /// Returns a copy of this column sorted by its values + /// + /// + public virtual DataFrameColumn Sort(bool ascending = true) + { + PrimitiveDataFrameColumn sortIndices = GetAscendingSortIndices(); + return Clone(sortIndices, !ascending, NullCount); + } + + public virtual Dictionary> GroupColumnValues() => throw new NotImplementedException(); + + /// + /// Returns a DataFrame containing counts of unique values + /// + public virtual DataFrame ValueCounts() => throw new NotImplementedException(); + + public virtual GroupBy GroupBy(int columnIndex, DataFrame parent) => throw new NotImplementedException(); + + /// + /// Returns a new column with elements replaced by . + /// + /// Tries to convert value to the column's DataType + /// + /// Indicates if the operation should be performed in place + public virtual DataFrameColumn FillNulls(object value, bool inPlace = false) => FillNullsImplementation(value, inPlace); + + protected virtual DataFrameColumn FillNullsImplementation(object value, bool inPlace) => throw new NotImplementedException(); + + // Arrow related APIs + protected internal virtual Field GetArrowField() => throw new NotImplementedException(); + /// + /// Returns the max number of values that are contiguous in memory + /// + protected internal virtual int GetMaxRecordBatchLength(long startIndex) => 0; + protected internal virtual Apache.Arrow.Array ToArrowArray(long startIndex, int numberOfRows) => throw new NotImplementedException(); + + /// + /// Creates a that will return the value of the column for the row + /// the cursor is referencing. + /// + /// + /// The row cursor which has the current position. + /// + protected internal virtual Delegate GetDataViewGetter(DataViewRowCursor cursor) => throw new NotImplementedException(); + + /// + /// Adds a new to the specified builder for the current column. + /// + /// + /// The builder to which to add the schema column. + /// + protected internal virtual void AddDataViewColumn(DataViewSchema.Builder builder) => throw new NotImplementedException(); + + /// + /// Clamps values beyond the specified thresholds + /// + /// + /// Minimum value. All values below this threshold will be set to it + /// Maximum value. All values above this threshold will be set to it + /// Indicates if the operation should be performed in place + public virtual DataFrameColumn Clamp(U min, U max, bool inPlace = false) => ClampImplementation(min, max, inPlace); + + /// + /// Clamps values beyond the specified thresholds + /// + /// + /// Minimum value. All values below this threshold will be set to it + /// Maximum value. All values above this threshold will be set to it + /// Indicates if the operation should be performed in place + protected virtual DataFrameColumn ClampImplementation(U min, U max, bool inPlace) => throw new NotImplementedException(); + + /// + /// Returns a new column filtered by the lower and upper bounds + /// + /// + /// The minimum value in the resulting column + /// The maximum value in the resulting column + public virtual DataFrameColumn Filter(U min, U max) => FilterImplementation(min, max); + + /// + /// Returns a new column filtered by the lower and upper bounds + /// + /// + /// + /// + protected virtual DataFrameColumn FilterImplementation(U min, U max) => throw new NotImplementedException(); + + /// + /// Determines if the column is of a numeric type + /// + public virtual bool IsNumericColumn() => false; + + /// + /// Returns the mean of the values in the column. Throws if this is not a numeric column + /// + public virtual double Mean() => throw new NotImplementedException(); + + /// + /// Returns the median of the values in the column. Throws if this is not a numeric column + /// + public virtual double Median() => throw new NotImplementedException(); + + /// + /// Used to exclude columns from the Description method + /// + public virtual bool HasDescription() => false; + + /// + /// Returns a containing the DataType and Length of this column + /// + public virtual StringDataFrameColumn Info() + { + StringDataFrameColumn dataColumn = new StringDataFrameColumn(Name, 2); + dataColumn[0] = DataType.ToString(); + dataColumn[1] = (Length - NullCount).ToString(); + return dataColumn; + } + + /// + /// Returns a with statistics that describe the column + /// + public virtual DataFrameColumn Description() => throw new NotImplementedException(); + + internal virtual PrimitiveDataFrameColumn GetAscendingSortIndices() => throw new NotImplementedException(); + + internal delegate long GetBufferSortIndex(int bufferIndex, int sortIndex); + internal delegate ValueTuple GetValueAndBufferSortIndexAtBuffer(int bufferIndex, int valueIndex); + internal delegate int GetBufferLengthAtIndex(int bufferIndex); + internal void PopulateColumnSortIndicesWithHeap(SortedDictionary>> heapOfValueAndListOfTupleOfSortAndBufferIndex, + PrimitiveDataFrameColumn columnSortIndices, + GetBufferSortIndex getBufferSortIndex, + GetValueAndBufferSortIndexAtBuffer getValueAndBufferSortIndexAtBuffer, + GetBufferLengthAtIndex getBufferLengthAtIndex) + { + while (heapOfValueAndListOfTupleOfSortAndBufferIndex.Count > 0) + { + KeyValuePair>> minElement = heapOfValueAndListOfTupleOfSortAndBufferIndex.ElementAt(0); + List> tuplesOfSortAndBufferIndex = minElement.Value; + (int sortIndex, int bufferIndex) sortAndBufferIndex; + if (tuplesOfSortAndBufferIndex.Count == 1) + { + heapOfValueAndListOfTupleOfSortAndBufferIndex.Remove(minElement.Key); + sortAndBufferIndex = tuplesOfSortAndBufferIndex[0]; + } + else + { + sortAndBufferIndex = tuplesOfSortAndBufferIndex[tuplesOfSortAndBufferIndex.Count - 1]; + tuplesOfSortAndBufferIndex.RemoveAt(tuplesOfSortAndBufferIndex.Count - 1); + } + int sortIndex = sortAndBufferIndex.sortIndex; + int bufferIndex = sortAndBufferIndex.bufferIndex; + long bufferSortIndex = getBufferSortIndex(bufferIndex, sortIndex); + columnSortIndices.Append(bufferSortIndex); + if (sortIndex + 1 < getBufferLengthAtIndex(bufferIndex)) + { + int nextSortIndex = sortIndex + 1; + (T value, int bufferSortIndex) nextValueAndBufferSortIndex = getValueAndBufferSortIndexAtBuffer(bufferIndex, nextSortIndex); + T nextValue = nextValueAndBufferSortIndex.value; + if (nextValue != null) + { + heapOfValueAndListOfTupleOfSortAndBufferIndex.Add(nextValue, new List>() { (nextValueAndBufferSortIndex.bufferSortIndex, bufferIndex) }); + } + } + } + + } + internal static int FloorLog2PlusOne(int n) + { + Debug.Assert(n >= 2); + int result = 2; + n >>= 2; + while (n > 0) + { + ++result; + n >>= 1; + } + return result; + } + + internal static void IntrospectiveSort( + ReadOnlySpan span, + int length, + Span sortIndices, + IComparer comparer) + { + var depthLimit = 2 * FloorLog2PlusOne(length); + IntroSortRecursive(span, 0, length - 1, depthLimit, sortIndices, comparer); + } + + internal static void IntroSortRecursive( + ReadOnlySpan span, + int lo, int hi, int depthLimit, + Span sortIndices, + IComparer comparer) + { + Debug.Assert(comparer != null); + Debug.Assert(lo >= 0); + + while (hi > lo) + { + int partitionSize = hi - lo + 1; + if (partitionSize <= 16) + { + if (partitionSize == 1) + { + return; + } + if (partitionSize == 2) + { + Sort2(span, lo, hi, sortIndices, comparer); + return; + } + if (partitionSize == 3) + { + Sort3(span, lo, hi - 1, hi, sortIndices, comparer); + return; + } + + InsertionSort(span, lo, hi, sortIndices, comparer); + return; + } + + if (depthLimit == 0) + { + HeapSort(span, lo, hi, sortIndices, comparer); + return; + } + depthLimit--; + + // We should never reach here, unless > 3 elements due to partition size + int p = PickPivotAndPartition(span, lo, hi, sortIndices, comparer); + // Note we've already partitioned around the pivot and do not have to move the pivot again. + IntroSortRecursive(span, p + 1, hi, depthLimit, sortIndices, comparer); + hi = p - 1; + } + } + + private static int PickPivotAndPartition( + ReadOnlySpan span, int lo, int hi, + Span sortIndices, + TComparer comparer) + where TComparer : IComparer + { + Debug.Assert(comparer != null); + Debug.Assert(lo >= 0); + Debug.Assert(hi > lo); + + // median-of-three + int middle = (int)(((uint)hi + (uint)lo) >> 1); + + // Sort lo, mid and hi appropriately, then pick mid as the pivot. + Sort3(span, lo, middle, hi, sortIndices, comparer); + + TKey pivot = span[sortIndices[middle]]; + + int left = lo; + int right = hi - 1; + // We already partitioned lo and hi and put the pivot in hi - 1. + Swap(ref sortIndices[middle], ref sortIndices[right]); + + while (left < right) + { + while (left < (hi - 1) && comparer.Compare(span[sortIndices[++left]], pivot) < 0) + ; + // Check if bad comparable/comparer + if (left == (hi - 1) && comparer.Compare(span[sortIndices[left]], pivot) < 0) + throw new ArgumentException("Bad comparer"); + + while (right > lo && comparer.Compare(pivot, span[sortIndices[--right]]) < 0) + ; + // Check if bad comparable/comparer + if (right == lo && comparer.Compare(pivot, span[sortIndices[right]]) < 0) + throw new ArgumentException("Bad comparer"); + + if (left >= right) + break; + + Swap(ref sortIndices[left], ref sortIndices[right]); + } + // Put pivot in the right location. + right = hi - 1; + if (left != right) + { + Swap(ref sortIndices[left], ref sortIndices[right]); + } + return left; + } + + internal static void Swap(ref TKey a, ref TKey b) + { + TKey temp = a; + a = b; + b = temp; + } + + private static void HeapSort( + ReadOnlySpan span, int lo, int hi, + Span sortIndices, + TComparer comparer) + where TComparer : IComparer + { + Debug.Assert(comparer != null); + Debug.Assert(lo >= 0); + Debug.Assert(hi > lo); + + int n = hi - lo + 1; + for (int i = n / 2; i >= 1; --i) + { + DownHeap(span, i, n, lo, sortIndices, comparer); + } + for (int i = n; i > 1; --i) + { + Swap(ref sortIndices[lo], ref sortIndices[lo + i - 1]); + DownHeap(span, 1, i - 1, lo, sortIndices, comparer); + } + } + + private static void DownHeap( + ReadOnlySpan span, int i, int n, int lo, + Span sortIndices, + TComparer comparer) + where TComparer : IComparer + { + // Max Heap + Debug.Assert(comparer != null); + Debug.Assert(lo >= 0); + + int di = sortIndices[lo - 1 + i]; + TKey d = span[di]; + var nHalf = n / 2; + while (i <= nHalf) + { + int child = i << 1; + + if (child < n && + comparer.Compare(span[sortIndices[lo + child - 1]], span[sortIndices[lo + child]]) < 0) + { + ++child; + } + + if (!(comparer.Compare(d, span[sortIndices[lo + child - 1]]) < 0)) + break; + + sortIndices[lo + i - 1] = sortIndices[lo + child - 1]; + + i = child; + } + sortIndices[lo + i - 1] = di; + } + + private static void InsertionSort( + ReadOnlySpan span, int lo, int hi, + Span sortIndices, + TComparer comparer) + where TComparer : IComparer + { + Debug.Assert(lo >= 0); + Debug.Assert(hi >= lo); + + for (int i = lo; i < hi; ++i) + { + int j = i; + var t = span[sortIndices[j + 1]]; + var ti = sortIndices[j + 1]; + if (j >= lo && comparer.Compare(t, span[sortIndices[j]]) < 0) + { + do + { + sortIndices[j + 1] = sortIndices[j]; + --j; + } + while (j >= lo && comparer.Compare(t, span[sortIndices[j]]) < 0); + + sortIndices[j + 1] = ti; + } + } + } + + private static void Sort3( + ReadOnlySpan span, int i, int j, int k, + Span sortIndices, + TComparer comparer) + where TComparer : IComparer + { + Sort2(span, i, j, sortIndices, comparer); + Sort2(span, i, k, sortIndices, comparer); + Sort2(span, j, k, sortIndices, comparer); + } + + private static void Sort2( + ReadOnlySpan span, int i, int j, + Span sortIndices, + IComparer comparer) + { + Debug.Assert(i != j); + if (comparer.Compare(span[sortIndices[i]], span[sortIndices[j]]) > 0) + { + int temp = sortIndices[i]; + sortIndices[i] = sortIndices[j]; + sortIndices[j] = temp; + } + } + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameColumnCollection.cs b/src/Microsoft.Data.Analysis/DataFrameColumnCollection.cs new file mode 100644 index 0000000000..2c3b72b28f --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameColumnCollection.cs @@ -0,0 +1,458 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace Microsoft.Data.Analysis +{ + /// + /// A DataFrameColumnCollection is just a container that holds a number of DataFrameColumn instances. + /// + public class DataFrameColumnCollection : Collection + { + private Action ColumnsChanged; + + private List _columnNames = new List(); + + private Dictionary _columnNameToIndexDictionary = new Dictionary(StringComparer.Ordinal); + + internal long RowCount { get; set; } + + internal DataFrameColumnCollection(IEnumerable columns, Action columnsChanged) : base() + { + columns = columns ?? throw new ArgumentNullException(nameof(columns)); + ColumnsChanged = columnsChanged; + foreach (DataFrameColumn column in columns) + { + Add(column); + } + } + + internal IReadOnlyList GetColumnNames() + { + var ret = new List(Count); + for (int i = 0; i < Count; i++) + { + ret.Add(this[i].Name); + } + return ret; + } + + public void SetColumnName(DataFrameColumn column, string newName) + { + string currentName = column.Name; + int currentIndex = _columnNameToIndexDictionary[currentName]; + column.SetName(newName); + _columnNames[currentIndex] = newName; + _columnNameToIndexDictionary.Remove(currentName); + _columnNameToIndexDictionary.Add(newName, currentIndex); + ColumnsChanged?.Invoke(); + } + + public void Insert(int columnIndex, IEnumerable column, string columnName) + where T : unmanaged + { + DataFrameColumn newColumn = new PrimitiveDataFrameColumn(columnName, column); + Insert(columnIndex, newColumn); // calls InsertItem internally + } + + protected override void InsertItem(int columnIndex, DataFrameColumn column) + { + column = column ?? throw new ArgumentNullException(nameof(column)); + if (RowCount > 0 && column.Length != RowCount) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + + if (Count >= 1 && RowCount == 0 && column.Length != RowCount) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + + if (_columnNameToIndexDictionary.ContainsKey(column.Name)) + { + throw new ArgumentException(string.Format(Strings.DuplicateColumnName, column.Name), nameof(column)); + } + RowCount = column.Length; + _columnNames.Insert(columnIndex, column.Name); + _columnNameToIndexDictionary[column.Name] = columnIndex; + for (int i = columnIndex + 1; i < Count; i++) + { + _columnNameToIndexDictionary[_columnNames[i]]++; + } + base.InsertItem(columnIndex, column); + ColumnsChanged?.Invoke(); + } + + protected override void SetItem(int columnIndex, DataFrameColumn column) + { + column = column ?? throw new ArgumentNullException(nameof(column)); + if (RowCount > 0 && column.Length != RowCount) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + bool existingColumn = _columnNameToIndexDictionary.TryGetValue(column.Name, out int existingColumnIndex); + if (existingColumn && existingColumnIndex != columnIndex) + { + throw new ArgumentException(string.Format(Strings.DuplicateColumnName, column.Name), nameof(column)); + } + _columnNameToIndexDictionary.Remove(_columnNames[columnIndex]); + _columnNames[columnIndex] = column.Name; + _columnNameToIndexDictionary[column.Name] = columnIndex; + base.SetItem(columnIndex, column); + ColumnsChanged?.Invoke(); + } + + protected override void RemoveItem(int columnIndex) + { + _columnNameToIndexDictionary.Remove(_columnNames[columnIndex]); + for (int i = columnIndex + 1; i < Count; i++) + { + _columnNameToIndexDictionary[_columnNames[i]]--; + } + _columnNames.RemoveAt(columnIndex); + base.RemoveItem(columnIndex); + ColumnsChanged?.Invoke(); + } + + public void Remove(string columnName) + { + int columnIndex = IndexOf(columnName); + if (columnIndex != -1) + { + RemoveAt(columnIndex); // calls RemoveItem internally + } + } + + /// + /// Searches for a with the specified and returns the zero-based index of the first occurrence if found. Returns -1 otherwise + /// + /// + public int IndexOf(string columnName) + { + if (columnName != null && _columnNameToIndexDictionary.TryGetValue(columnName, out int columnIndex)) + { + return columnIndex; + } + return -1; + } + + protected override void ClearItems() + { + base.ClearItems(); + ColumnsChanged?.Invoke(); + _columnNames.Clear(); + _columnNameToIndexDictionary.Clear(); + } + + /// + /// An indexer based on + /// + /// The name of a + /// A if it exists. + /// Throws if is not present in this + public DataFrameColumn this[string columnName] + { + get + { + int columnIndex = IndexOf(columnName); + if (columnIndex == -1) + { + throw new ArgumentException(Strings.InvalidColumnName, nameof(columnName)); + } + return this[columnIndex]; + } + set + { + int columnIndex = IndexOf(columnName); + DataFrameColumn newColumn = value; + newColumn.SetName(columnName); + if (columnIndex == -1) + { + Insert(Count, newColumn); + } + else + { + this[columnIndex] = newColumn; + } + } + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public PrimitiveDataFrameColumn GetPrimitiveColumn(string name) + where T : unmanaged + { + DataFrameColumn column = this[name]; + if (column is PrimitiveDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(T)), nameof(T)); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public ArrowStringDataFrameColumn GetArrowStringColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is ArrowStringDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(string))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public StringDataFrameColumn GetStringColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is StringDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(string))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public BooleanDataFrameColumn GetBooleanColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is BooleanDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Boolean))); + } + + /// + /// Gets the with the specified and attempts to return it as an . If is not of type , an exception is thrown. + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public ByteDataFrameColumn GetByteColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is ByteDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Byte))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public CharDataFrameColumn GetCharColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is CharDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Char))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public DoubleDataFrameColumn GetDoubleColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is DoubleDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Double))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public DecimalDataFrameColumn GetDecimalColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is DecimalDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Decimal))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public SingleDataFrameColumn GetSingleColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is SingleDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Single))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public Int32DataFrameColumn GetInt32Column(string name) + { + DataFrameColumn column = this[name]; + if (column is Int32DataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Int32))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public Int64DataFrameColumn GetInt64Column(string name) + { + DataFrameColumn column = this[name]; + if (column is Int64DataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Int64))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public SByteDataFrameColumn GetSByteColumn(string name) + { + DataFrameColumn column = this[name]; + if (column is SByteDataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(SByte))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public Int16DataFrameColumn GetInt16Column(string name) + { + DataFrameColumn column = this[name]; + if (column is Int16DataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(Int16))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public UInt32DataFrameColumn GetUInt32Column(string name) + { + DataFrameColumn column = this[name]; + if (column is UInt32DataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(string))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public UInt64DataFrameColumn GetUInt64Column(string name) + { + DataFrameColumn column = this[name]; + if (column is UInt64DataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(UInt64))); + } + + /// + /// Gets the with the specified . + /// + /// The name of the column + /// . + /// A column named cannot be found, or if the column's type doesn't match. + public UInt16DataFrameColumn GetUInt16Column(string name) + { + DataFrameColumn column = this[name]; + if (column is UInt16DataFrameColumn ret) + { + return ret; + } + + throw new ArgumentException(string.Format(Strings.BadColumnCast, column.DataType, typeof(UInt16))); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameRow.cs b/src/Microsoft.Data.Analysis/DataFrameRow.cs new file mode 100644 index 0000000000..812fd69721 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameRow.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + /// + /// A DataFrameRow is a collection of values that represent a row in a . + /// + public class DataFrameRow : IEnumerable + { + private readonly DataFrame _dataFrame; + private readonly long _rowIndex; + internal DataFrameRow(DataFrame df, long rowIndex) + { + Debug.Assert(rowIndex < df.Columns.RowCount); + _dataFrame = df; + _rowIndex = rowIndex; + } + + /// + /// Returns an enumerator of the values in this row. + /// + public IEnumerator GetEnumerator() + { + foreach (DataFrameColumn column in _dataFrame.Columns) + { + yield return column[_rowIndex]; + } + } + + /// + /// An indexer to return the value at . + /// + /// The index of the value to return + /// The value at this . + public object this[int index] + { + get + { + return _dataFrame.Columns[index][_rowIndex]; + } + set + { + _dataFrame.Columns[index][_rowIndex] = value; + } + } + + /// + /// A simple string representation of the values in this row + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + foreach (object value in this) + { + sb.Append(value?.ToString() ?? "null").Append(" "); + } + return sb.ToString(); + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + } +} diff --git a/src/Microsoft.Data.Analysis/DataFrameRowCollection.cs b/src/Microsoft.Data.Analysis/DataFrameRowCollection.cs new file mode 100644 index 0000000000..85af70f76e --- /dev/null +++ b/src/Microsoft.Data.Analysis/DataFrameRowCollection.cs @@ -0,0 +1,56 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + /// + /// Represents the rows of a + /// + public class DataFrameRowCollection : IEnumerable + { + private readonly DataFrame _dataFrame; + + /// + /// Initializes a . + /// + internal DataFrameRowCollection(DataFrame dataFrame) + { + _dataFrame = dataFrame ?? throw new ArgumentNullException(nameof(dataFrame)); + } + + /// + /// An indexer to return the at + /// + /// The row index + public DataFrameRow this[long index] + { + get + { + return new DataFrameRow(_dataFrame, index); + } + } + + /// + /// Returns an enumerator of objects + /// + public IEnumerator GetEnumerator() + { + for (long i = 0; i < Count; i++) + { + yield return new DataFrameRow(_dataFrame, i); + } + } + + /// + /// The number of rows in this . + /// + public long Count => _dataFrame.Columns.RowCount; + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + } +} diff --git a/src/Microsoft.Data.Analysis/DecimalDataFrameColumn.cs b/src/Microsoft.Data.Analysis/DecimalDataFrameColumn.cs new file mode 100644 index 0000000000..b0b4fafd04 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DecimalDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class DecimalDataFrameColumn : PrimitiveDataFrameColumn + { + public DecimalDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public DecimalDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public DecimalDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public DecimalDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal DecimalDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/DoubleDataFrameColumn.cs b/src/Microsoft.Data.Analysis/DoubleDataFrameColumn.cs new file mode 100644 index 0000000000..6a97300376 --- /dev/null +++ b/src/Microsoft.Data.Analysis/DoubleDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class DoubleDataFrameColumn : PrimitiveDataFrameColumn + { + public DoubleDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public DoubleDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public DoubleDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public DoubleDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal DoubleDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/GroupBy.cs b/src/Microsoft.Data.Analysis/GroupBy.cs new file mode 100644 index 0000000000..5d8013e9b6 --- /dev/null +++ b/src/Microsoft.Data.Analysis/GroupBy.cs @@ -0,0 +1,468 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + /// + /// A GroupBy class that is typically the result of a DataFrame.GroupBy call. + /// It holds information to perform typical aggregation ops on it. + /// + public abstract class GroupBy + { + /// + /// Compute the number of non-null values in each group + /// + /// + public abstract DataFrame Count(params string[] columnNames); + + /// + /// Return the first value in each group + /// + /// + public abstract DataFrame First(params string[] columnNames); + + /// + /// Returns the first rows of each group + /// + /// + /// + public abstract DataFrame Head(int numberOfRows); + + /// + /// Returns the last rows of each group + /// + /// + /// + public abstract DataFrame Tail(int numberOfRows); + + /// + /// Compute the max of group values + /// + /// The columns to find the max of. A default value finds the max of all columns + public abstract DataFrame Max(params string[] columnNames); + + /// + /// Compute the min of group values + /// + /// The columns to find the min of. A default value finds the min of all columns + public abstract DataFrame Min(params string[] columnNames); + + /// + /// Compute the product of group values + /// + /// The columns to find the product of. A default value finds the product of all columns + public abstract DataFrame Product(params string[] columnNames); + + /// + /// Compute the sum of group values + /// + /// The columns to sum. A Default value sums up all columns + public abstract DataFrame Sum(params string[] columnNames); + + /// + /// Compute the mean of group values + /// + /// The columns to find the mean of. A Default value finds the mean of all columns + public abstract DataFrame Mean(params string[] columnNames); + } + + public class GroupBy : GroupBy + { + private int _groupByColumnIndex; + private IDictionary> _keyToRowIndicesMap; + private DataFrame _dataFrame; + + public GroupBy(DataFrame dataFrame, int groupByColumnIndex, IDictionary> keyToRowIndices) + { + if (dataFrame.Columns.Count < groupByColumnIndex || groupByColumnIndex < 0) + throw new ArgumentException(nameof(groupByColumnIndex)); + _groupByColumnIndex = groupByColumnIndex; + _keyToRowIndicesMap = keyToRowIndices ?? throw new ArgumentException(nameof(keyToRowIndices)); + _dataFrame = dataFrame ?? throw new ArgumentException(nameof(dataFrame)); + } + + private delegate void ColumnDelegate(int columnIndex, long rowIndex, ICollection rows, TKey key, bool firstGroup); + private delegate void GroupByColumnDelegate(long rowNumber, TKey key); + private void EnumerateColumnsWithRows(GroupByColumnDelegate groupByColumnDelegate, ColumnDelegate columnDelegate, params string[] columnNames) + { + long rowNumber = 0; + bool firstGroup = true; + foreach (KeyValuePair> pairs in _keyToRowIndicesMap) + { + groupByColumnDelegate(rowNumber, pairs.Key); + ICollection rows = pairs.Value; + IEnumerable columns = columnNames; + if (columnNames == null || columnNames.Length == 0) + columns = _dataFrame.GetColumnNames(); + // Assuming that the dataframe has not been modified after the groupby call + foreach (string columnName in columns) + { + int columnIndex = _dataFrame.Columns.IndexOf(columnName); + columnDelegate(columnIndex, rowNumber, rows, pairs.Key, firstGroup); + } + firstGroup = false; + rowNumber++; + } + + } + + public override DataFrame Count(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + if (columnIndex == _groupByColumnIndex) + return; + DataFrameColumn column = _dataFrame.Columns[columnIndex]; + long count = 0; + foreach (long row in rowEnumerable) + { + if (column[row] != null) + count++; + } + DataFrameColumn retColumn; + if (firstGroup) + { + retColumn = new PrimitiveDataFrameColumn(column.Name); + ret.Columns.Insert(ret.Columns.Count, retColumn); + } + else + { + // Assuming non duplicate column names + retColumn = ret.Columns[column.Name]; + } + retColumn.Resize(rowIndex + 1); + retColumn[rowIndex] = count; + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + + return ret; + } + + public override DataFrame First(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + if (columnIndex == _groupByColumnIndex) + return; + DataFrameColumn column = _dataFrame.Columns[columnIndex]; + foreach (long row in rowEnumerable) + { + DataFrameColumn retColumn; + if (firstGroup) + { + retColumn = column.Clone(empty); + ret.Columns.Insert(ret.Columns.Count, retColumn); + } + else + { + // Assuming non duplicate column names + retColumn = ret.Columns[column.Name]; + } + retColumn.Resize(rowIndex + 1); + retColumn[rowIndex] = column[row]; + break; + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + return ret; + } + + public override DataFrame Head(int numberOfRows) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + if (columnIndex == _groupByColumnIndex) + return; + DataFrameColumn column = _dataFrame.Columns[columnIndex]; + long count = 0; + bool firstRow = true; + foreach (long row in rowEnumerable) + { + if (count < numberOfRows) + { + DataFrameColumn retColumn; + if (firstGroup && firstRow) + { + firstRow = false; + retColumn = column.Clone(empty); + ret.Columns.Insert(ret.Columns.Count, retColumn); + } + else + { + // Assuming non duplicate column names + retColumn = ret.Columns[column.Name]; + } + long retColumnLength = retColumn.Length; + retColumn.Resize(retColumnLength + 1); + retColumn[retColumnLength] = column[row]; + if (firstColumn.Length <= retColumnLength) + { + firstColumn.Resize(retColumnLength + 1); + } + firstColumn[retColumnLength] = key; + count++; + } + if (count == numberOfRows) + break; + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate); + ret.SetTableRowCount(firstColumn.Length); + return ret; + } + + public override DataFrame Tail(int numberOfRows) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + if (columnIndex == _groupByColumnIndex) + return; + DataFrameColumn column = _dataFrame.Columns[columnIndex]; + long count = 0; + bool firstRow = true; + ICollection values = _keyToRowIndicesMap[key]; + int numberOfValues = values.Count; + foreach (long row in rowEnumerable) + { + if (count >= numberOfValues - numberOfRows) + { + DataFrameColumn retColumn; + if (firstGroup && firstRow) + { + firstRow = false; + retColumn = column.Clone(empty); + ret.Columns.Insert(ret.Columns.Count, retColumn); + } + else + { + // Assuming non duplicate column names + retColumn = ret.Columns[column.Name]; + } + long retColumnLength = retColumn.Length; + if (firstColumn.Length <= retColumnLength) + { + firstColumn.Resize(retColumnLength + 1); + firstColumn[retColumnLength] = key; + } + retColumn.Resize(retColumnLength + 1); + retColumn[retColumnLength] = column[row]; + } + count++; + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate); + ret.SetTableRowCount(firstColumn.Length); + return ret; + } + + private DataFrameColumn ResizeAndInsertColumn(int columnIndex, long rowIndex, bool firstGroup, DataFrame ret, PrimitiveDataFrameColumn empty, Func getColumn = null) + { + if (columnIndex == _groupByColumnIndex) + return null; + DataFrameColumn column = _dataFrame.Columns[columnIndex]; + DataFrameColumn retColumn; + if (firstGroup) + { + retColumn = getColumn == null ? column.Clone(empty) : getColumn(column.Name); + ret.Columns.Insert(ret.Columns.Count, retColumn); + } + else + { + // Assuming unique column names + retColumn = ret.Columns[column.Name]; + } + retColumn.Resize(rowIndex + 1); + return retColumn; + } + + public override DataFrame Max(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + DataFrameColumn retColumn = ResizeAndInsertColumn(columnIndex, rowIndex, firstGroup, ret, empty); + + if (!(retColumn is null)) + { + retColumn[rowIndex] = _dataFrame.Columns[columnIndex].Max(rowEnumerable); + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + + return ret; + } + + public override DataFrame Min(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + DataFrameColumn retColumn = ResizeAndInsertColumn(columnIndex, rowIndex, firstGroup, ret, empty); + + if (!(retColumn is null)) + { + retColumn[rowIndex] = _dataFrame.Columns[columnIndex].Min(rowEnumerable); + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + + return ret; + } + + public override DataFrame Product(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + DataFrameColumn retColumn = ResizeAndInsertColumn(columnIndex, rowIndex, firstGroup, ret, empty); + + if (!(retColumn is null)) + { + retColumn[rowIndex] = _dataFrame.Columns[columnIndex].Product(rowEnumerable); + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + + return ret; + } + + public override DataFrame Sum(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + DataFrameColumn retColumn = ResizeAndInsertColumn(columnIndex, rowIndex, firstGroup, ret, empty); + + if (!(retColumn is null)) + { + retColumn[rowIndex] = _dataFrame.Columns[columnIndex].Sum(rowEnumerable); + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + + return ret; + } + + public override DataFrame Mean(params string[] columnNames) + { + DataFrame ret = new DataFrame(); + PrimitiveDataFrameColumn empty = new PrimitiveDataFrameColumn("Empty"); + DataFrameColumn firstColumn = _dataFrame.Columns[_groupByColumnIndex].Clone(empty); + ret.Columns.Insert(ret.Columns.Count, firstColumn); + GroupByColumnDelegate groupByColumnDelegate = new GroupByColumnDelegate((long rowIndex, TKey key) => + { + firstColumn.Resize(rowIndex + 1); + firstColumn[rowIndex] = key; + }); + + + ColumnDelegate columnDelegate = new ColumnDelegate((int columnIndex, long rowIndex, ICollection rowEnumerable, TKey key, bool firstGroup) => + { + DataFrameColumn retColumn = ResizeAndInsertColumn(columnIndex, rowIndex, firstGroup, ret, empty, (name) => new PrimitiveDataFrameColumn(name)); + + if (!(retColumn is null)) + { + retColumn[rowIndex] = (double)Convert.ChangeType(_dataFrame.Columns[columnIndex].Sum(rowEnumerable), typeof(double)) / rowEnumerable.Count; + } + }); + + EnumerateColumnsWithRows(groupByColumnDelegate, columnDelegate, columnNames); + ret.SetTableRowCount(firstColumn.Length); + + return ret; + } + + } +} diff --git a/src/Microsoft.Data.Analysis/Int16DataFrameColumn.cs b/src/Microsoft.Data.Analysis/Int16DataFrameColumn.cs new file mode 100644 index 0000000000..79893b1899 --- /dev/null +++ b/src/Microsoft.Data.Analysis/Int16DataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class Int16DataFrameColumn : PrimitiveDataFrameColumn + { + public Int16DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public Int16DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public Int16DataFrameColumn(string name, long length = 0) : base(name, length) { } + + public Int16DataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal Int16DataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/Int32DataFrameColumn.cs b/src/Microsoft.Data.Analysis/Int32DataFrameColumn.cs new file mode 100644 index 0000000000..91b15764cd --- /dev/null +++ b/src/Microsoft.Data.Analysis/Int32DataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class Int32DataFrameColumn : PrimitiveDataFrameColumn + { + public Int32DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public Int32DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public Int32DataFrameColumn(string name, long length = 0) : base(name, length) { } + + public Int32DataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal Int32DataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/Int64DataFrameColumn.cs b/src/Microsoft.Data.Analysis/Int64DataFrameColumn.cs new file mode 100644 index 0000000000..f955404152 --- /dev/null +++ b/src/Microsoft.Data.Analysis/Int64DataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class Int64DataFrameColumn : PrimitiveDataFrameColumn + { + public Int64DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public Int64DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public Int64DataFrameColumn(string name, long length = 0) : base(name, length) { } + + public Int64DataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal Int64DataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj b/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj new file mode 100644 index 0000000000..5511c493a4 --- /dev/null +++ b/src/Microsoft.Data.Analysis/Microsoft.Data.Analysis.csproj @@ -0,0 +1,250 @@ + + + + netstandard2.0 + true + false + This package contains easy-to-use and high-performance libraries for data analysis and transformation. + Initial preview of robust and extensible types and algorithms for manipulating structured data that supports aggregations, statistical funtions, sorting, grouping, joins, merges, handling missing values and more. + ML.NET ML Machine Learning Data Science DataFrame Preparation DataView Analytics Exploration + true + + $(NoWarn);1591;NU5100;MSML_GeneralName;MSML_ParameterLocalVarName;MSML_PrivateFieldName;MSML_TypeParamName;SA1028;SA1507;SX1101;MSML_NoInstanceInitializers + $(TargetsForTfmSpecificContentInPackage);AddMDAIToInteractiveExtensionsFolder + + + + + + + + + + + <_ItemsToIncludeForInteractive Update="@(_ItemsToIncludeForInteractive)" PackagePath="interactive-extensions/dotnet" /> + + + + + + + True + True + Converters.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperators.tt + + + + + + + + + + + + + + + + + + TextTemplatingFileGenerator + Converters.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.cs + + + TextTemplatingFileGenerator + DataFrameColumn.BinaryOperations.cs + + + TextTemplatingFileGenerator + DataFrameColumn.BinaryOperators.cs + + + TextTemplatingFileGenerator + DataFrameColumn.Computations.cs + + + TextTemplatingFileGenerator + DataFrame.BinaryOperations.cs + + + TextTemplatingFileGenerator + DataFrame.BinaryOperators.cs + + + TextTemplatingFileGenerator + DataFrameBinaryOperators.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude + + + True + True + PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperations.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.BinaryOperators.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.Computations.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumn.ReversedBinaryOperations.cs + + + TextTemplatingFileGenerator + PrimitiveColumnArithmetic.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumnComputations.cs + + + TextTemplatingFileGenerator + PrimitiveColumnContainer.BinaryOperations.cs + + + TextTemplatingFileGenerator + PrimitiveDataFrameColumnArithmetic.cs + + + TextTemplatingFileGenerator + PrimitiveColumnContainer.BinaryOperations.cs + + + + + + + + + + True + True + Converters.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.tt + + + True + True + DataFrameColumn.BinaryOperations.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt + + + True + True + DataFrameColumn.BinaryOperators.tt + + + True + True + DataFrameColumn.Computations.tt + + + True + True + DataFrame.BinaryOperations.tt + + + True + True + DataFrame.BinaryOperators.tt + + + True + True + DataFrameBinaryOperators.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperations.tt + + + True + True + PrimitiveDataFrameColumn.BinaryOperators.tt + + + True + True + PrimitiveDataFrameColumn.Computations.tt + + + True + True + PrimitiveDataFrameColumn.ReversedBinaryOperations.tt + + + True + True + PrimitiveColumnArithmetic.tt + + + True + True + PrimitiveDataFrameColumnComputations.tt + + + True + True + PrimitiveColumnContainer.BinaryOperations.tt + + + True + True + PrimitiveDataFrameColumnArithmetic.tt + + + True + True + PrimitiveColumnContainer.BinaryOperations.tt + + + True + True + Strings.resx + + + + + + ResXFileCodeGenerator + Strings.Designer.cs + Microsoft.Data + + + diff --git a/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.cs b/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.cs new file mode 100644 index 0000000000..f8a8410a39 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.cs @@ -0,0 +1,234 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveColumnContainer.BinaryOperations.tt. Do not modify directly + +namespace Microsoft.Data.Analysis +{ + internal partial class PrimitiveColumnContainer + where T : struct + { + public PrimitiveColumnContainer Add(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Add(this, right); + return this; + } + + public PrimitiveColumnContainer Add(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Add(this, scalar); + return this; + } + + public PrimitiveColumnContainer Subtract(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Subtract(this, right); + return this; + } + + public PrimitiveColumnContainer Subtract(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Subtract(this, scalar); + return this; + } + + public PrimitiveColumnContainer Multiply(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Multiply(this, right); + return this; + } + + public PrimitiveColumnContainer Multiply(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Multiply(this, scalar); + return this; + } + + public PrimitiveColumnContainer Divide(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Divide(this, right); + return this; + } + + public PrimitiveColumnContainer Divide(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Divide(this, scalar); + return this; + } + + public PrimitiveColumnContainer Modulo(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Modulo(this, right); + return this; + } + + public PrimitiveColumnContainer Modulo(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Modulo(this, scalar); + return this; + } + + public PrimitiveColumnContainer And(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.And(this, right); + return this; + } + + public PrimitiveColumnContainer And(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.And(this, scalar); + return this; + } + + public PrimitiveColumnContainer Or(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Or(this, right); + return this; + } + + public PrimitiveColumnContainer Or(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Or(this, scalar); + return this; + } + + public PrimitiveColumnContainer Xor(PrimitiveColumnContainer right) + { + PrimitiveDataFrameColumnArithmetic.Instance.Xor(this, right); + return this; + } + + public PrimitiveColumnContainer Xor(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Xor(this, scalar); + return this; + } + + public PrimitiveColumnContainer LeftShift(int value) + { + PrimitiveDataFrameColumnArithmetic.Instance.LeftShift(this, value); + return this; + } + + public PrimitiveColumnContainer RightShift(int value) + { + PrimitiveDataFrameColumnArithmetic.Instance.RightShift(this, value); + return this; + } + + public PrimitiveColumnContainer ElementwiseEquals(PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseEquals(this, right, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseEquals(T scalar, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseEquals(this, scalar, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseNotEquals(PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseNotEquals(this, right, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseNotEquals(T scalar, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseNotEquals(this, scalar, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseGreaterThanOrEqual(this, right, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseGreaterThanOrEqual(T scalar, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseGreaterThanOrEqual(this, scalar, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseLessThanOrEqual(PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseLessThanOrEqual(this, right, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseLessThanOrEqual(T scalar, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseLessThanOrEqual(this, scalar, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseGreaterThan(PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseGreaterThan(this, right, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseGreaterThan(T scalar, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseGreaterThan(this, scalar, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseLessThan(PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseLessThan(this, right, ret); + return this; + } + + public PrimitiveColumnContainer ElementwiseLessThan(T scalar, PrimitiveColumnContainer ret) + { + PrimitiveDataFrameColumnArithmetic.Instance.ElementwiseLessThan(this, scalar, ret); + return this; + } + + public PrimitiveColumnContainer ReverseAdd(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Add(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseSubtract(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Subtract(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseMultiply(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Multiply(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseDivide(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Divide(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseModulo(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Modulo(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseAnd(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.And(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseOr(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Or(scalar, this); + return this; + } + public PrimitiveColumnContainer ReverseXor(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.Xor(scalar, this); + return this; + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.tt b/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.tt new file mode 100644 index 0000000000..1006508524 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.BinaryOperations.tt @@ -0,0 +1,56 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveColumnContainer.BinaryOperations.tt. Do not modify directly + +namespace Microsoft.Data.Analysis +{ + internal partial class PrimitiveColumnContainer + where T : struct + { +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.Comparison || method.MethodType == MethodType.ComparisonScalar) { #> + public <#= method.GetSingleArgumentMethodSignature("PrimitiveColumnContainer", "T") #> + { +<# if (method.MethodType == MethodType.ComparisonScalar ) { #> + PrimitiveDataFrameColumnArithmetic.Instance.<#=method.MethodName#>(this, scalar, ret); +<# } else { #> + PrimitiveDataFrameColumnArithmetic.Instance.<#=method.MethodName#>(this, right, ret); +<# } #> + return this; + } + +<# } else { #> + public <#= method.GetSingleArgumentMethodSignature("PrimitiveColumnContainer", "T")#> + { +<# if (method.MethodType == MethodType.BinaryScalar) { #> + PrimitiveDataFrameColumnArithmetic.Instance.<#=method.MethodName#>(this, scalar); +<# } else if (method.MethodType == MethodType.BinaryInt) { #> + PrimitiveDataFrameColumnArithmetic.Instance.<#=method.MethodName#>(this, value); +<# } else { #> + PrimitiveDataFrameColumnArithmetic.Instance.<#=method.MethodName#>(this, right); +<# } #> + return this; + } + +<# } #> +<# } #> +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) { #> + public PrimitiveColumnContainer Reverse<#=method.MethodName#>(T scalar) + { + PrimitiveDataFrameColumnArithmetic.Instance.<#=method.MethodName#>(scalar, this); + return this; + } +<# } #> +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.cs b/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.cs new file mode 100644 index 0000000000..2e04f63fee --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveColumnContainer.cs @@ -0,0 +1,850 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + /// + /// PrimitiveDataFrameColumnContainer is just a store for the column data. APIs that want to change the data must be defined in PrimitiveDataFrameColumn + /// + /// + internal partial class PrimitiveColumnContainer : IEnumerable + where T : struct + { + public IList> Buffers = new List>(); + + // To keep the mapping simple, each buffer is mapped 1v1 to a nullBitMapBuffer + // A set bit implies a valid value. An unset bit => null value + public IList> NullBitMapBuffers = new List>(); + + // Need a way to differentiate between columns initialized with default values and those with null values in SetValidityBit + internal bool _modifyNullCountWhileIndexing = true; + + public PrimitiveColumnContainer(T[] values) + { + values = values ?? throw new ArgumentNullException(nameof(values)); + long length = values.LongLength; + DataFrameBuffer curBuffer; + if (Buffers.Count == 0) + { + curBuffer = new DataFrameBuffer(); + Buffers.Add(curBuffer); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + else + { + curBuffer = (DataFrameBuffer)Buffers[Buffers.Count - 1]; + } + for (long i = 0; i < length; i++) + { + if (curBuffer.Length == ReadOnlyDataFrameBuffer.MaxCapacity) + { + curBuffer = new DataFrameBuffer(); + Buffers.Add(curBuffer); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + curBuffer.Append(values[i]); + SetValidityBit(Length, true); + Length++; + } + } + + public PrimitiveColumnContainer(IEnumerable values) + { + values = values ?? throw new ArgumentNullException(nameof(values)); + foreach (T value in values) + { + Append(value); + } + } + public PrimitiveColumnContainer(IEnumerable values) + { + values = values ?? throw new ArgumentNullException(nameof(values)); + foreach (T? value in values) + { + Append(value); + } + } + + public PrimitiveColumnContainer(ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length, int nullCount) + { + ReadOnlyDataFrameBuffer dataBuffer; + if (buffer.IsEmpty) + { + DataFrameBuffer mutableBuffer = new DataFrameBuffer(); + mutableBuffer.EnsureCapacity(length); + mutableBuffer.Length = length; + mutableBuffer.RawSpan.Fill(default(T)); + dataBuffer = mutableBuffer; + } + else + { + dataBuffer = new ReadOnlyDataFrameBuffer(buffer, length); + } + Buffers.Add(dataBuffer); + int bitMapBufferLength = (length + 7) / 8; + ReadOnlyDataFrameBuffer nullDataFrameBuffer; + if (nullBitMap.IsEmpty) + { + if (nullCount != 0) + { + throw new ArgumentNullException(Strings.InconsistentNullBitMapAndNullCount, nameof(nullBitMap)); + } + if (!buffer.IsEmpty) + { + // Create a new bitMap with all the bits up to length set + var bitMap = new byte[bitMapBufferLength]; + bitMap.AsSpan().Fill(255); + int lastByte = 1 << (length - (bitMapBufferLength - 1) * 8); + bitMap[bitMapBufferLength - 1] = (byte)(lastByte - 1); + nullDataFrameBuffer = new DataFrameBuffer(bitMap, bitMapBufferLength); + } + else + { + nullDataFrameBuffer = new DataFrameBuffer(); + } + } + else + { + if (nullBitMap.Length < bitMapBufferLength) + { + throw new ArgumentException(Strings.InconsistentNullBitMapAndLength, nameof(nullBitMap)); + } + nullDataFrameBuffer = new ReadOnlyDataFrameBuffer(nullBitMap, bitMapBufferLength); + } + NullBitMapBuffers.Add(nullDataFrameBuffer); + Length = length; + NullCount = nullCount; + } + + public PrimitiveColumnContainer(long length = 0) + { + while (length > 0) + { + if (Buffers.Count == 0) + { + Buffers.Add(new DataFrameBuffer()); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + DataFrameBuffer lastBuffer = (DataFrameBuffer)Buffers[Buffers.Count - 1]; + if (lastBuffer.Length == ReadOnlyDataFrameBuffer.MaxCapacity) + { + lastBuffer = new DataFrameBuffer(); + Buffers.Add(lastBuffer); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + int allocatable = (int)Math.Min(length, ReadOnlyDataFrameBuffer.MaxCapacity); + lastBuffer.EnsureCapacity(allocatable); + DataFrameBuffer lastNullBitMapBuffer = (DataFrameBuffer)(NullBitMapBuffers[NullBitMapBuffers.Count - 1]); + int nullBufferAllocatable = (allocatable + 7) / 8; + lastNullBitMapBuffer.EnsureCapacity(nullBufferAllocatable); + lastBuffer.Length = allocatable; + lastNullBitMapBuffer.Length = nullBufferAllocatable; + length -= allocatable; + Length += lastBuffer.Length; + NullCount += lastBuffer.Length; + } + } + + public void Resize(long length) + { + if (length < Length) + throw new ArgumentException(Strings.CannotResizeDown, nameof(length)); + AppendMany(default, length - Length); + } + + public void Append(T? value) + { + if (Buffers.Count == 0) + { + Buffers.Add(new DataFrameBuffer()); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + int bufferIndex = Buffers.Count - 1; + ReadOnlyDataFrameBuffer lastBuffer = Buffers[bufferIndex]; + if (lastBuffer.Length == ReadOnlyDataFrameBuffer.MaxCapacity) + { + lastBuffer = new DataFrameBuffer(); + Buffers.Add(lastBuffer); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + DataFrameBuffer mutableLastBuffer = DataFrameBuffer.GetMutableBuffer(lastBuffer); + Buffers[bufferIndex] = mutableLastBuffer; + mutableLastBuffer.Append(value ?? default); + SetValidityBit(Length, value.HasValue); + Length++; + } + + public void AppendMany(T? value, long count) + { + if (!value.HasValue) + { + NullCount += count; + } + + while (count > 0) + { + if (Buffers.Count == 0) + { + Buffers.Add(new DataFrameBuffer()); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + int bufferIndex = Buffers.Count - 1; + ReadOnlyDataFrameBuffer lastBuffer = Buffers[bufferIndex]; + if (lastBuffer.Length == ReadOnlyDataFrameBuffer.MaxCapacity) + { + lastBuffer = new DataFrameBuffer(); + Buffers.Add(lastBuffer); + NullBitMapBuffers.Add(new DataFrameBuffer()); + } + DataFrameBuffer mutableLastBuffer = DataFrameBuffer.GetMutableBuffer(lastBuffer); + Buffers[bufferIndex] = mutableLastBuffer; + int allocatable = (int)Math.Min(count, ReadOnlyDataFrameBuffer.MaxCapacity); + mutableLastBuffer.EnsureCapacity(allocatable); + mutableLastBuffer.RawSpan.Slice(lastBuffer.Length, allocatable).Fill(value ?? default); + mutableLastBuffer.Length += allocatable; + Length += allocatable; + + int nullBitMapBufferIndex = NullBitMapBuffers.Count - 1; + ReadOnlyDataFrameBuffer lastNullBitMapBuffer = NullBitMapBuffers[nullBitMapBufferIndex]; + DataFrameBuffer mutableLastNullBitMapBuffer = DataFrameBuffer.GetMutableBuffer(lastNullBitMapBuffer); + NullBitMapBuffers[nullBitMapBufferIndex] = mutableLastNullBitMapBuffer; + int nullBitMapAllocatable = (int)(((uint)allocatable) / 8) + 1; + mutableLastNullBitMapBuffer.EnsureCapacity(nullBitMapAllocatable); + _modifyNullCountWhileIndexing = false; + for (long i = Length - count; i < Length; i++) + { + SetValidityBit(i, value.HasValue ? true : false); + } + _modifyNullCountWhileIndexing = true; + count -= allocatable; + } + } + + public void ApplyElementwise(Func func) + { + for (int b = 0; b < Buffers.Count; b++) + { + ReadOnlyDataFrameBuffer buffer = Buffers[b]; + long prevLength = checked(Buffers[0].Length * b); + DataFrameBuffer mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + Buffers[b] = mutableBuffer; + Span span = mutableBuffer.Span; + DataFrameBuffer mutableNullBitMapBuffer = DataFrameBuffer.GetMutableBuffer(NullBitMapBuffers[b]); + NullBitMapBuffers[b] = mutableNullBitMapBuffer; + Span nullBitMapSpan = mutableNullBitMapBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + long curIndex = i + prevLength; + bool isValid = IsValid(nullBitMapSpan, i); + T? value = func(isValid ? span[i] : default(T?), curIndex); + span[i] = value.GetValueOrDefault(); + SetValidityBit(nullBitMapSpan, i, value != null); + } + } + } + + public void Apply(Func func, PrimitiveColumnContainer resultContainer) + where TResult : unmanaged + { + for (int b = 0; b < Buffers.Count; b++) + { + ReadOnlyDataFrameBuffer buffer = Buffers[b]; + long prevLength = checked(Buffers[0].Length * b); + DataFrameBuffer mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + Buffers[b] = mutableBuffer; + Span span = mutableBuffer.Span; + DataFrameBuffer mutableNullBitMapBuffer = DataFrameBuffer.GetMutableBuffer(NullBitMapBuffers[b]); + NullBitMapBuffers[b] = mutableNullBitMapBuffer; + Span nullBitMapSpan = mutableNullBitMapBuffer.Span; + + ReadOnlyDataFrameBuffer resultBuffer = resultContainer.Buffers[b]; + long resultPrevLength = checked(resultContainer.Buffers[0].Length * b); + DataFrameBuffer resultMutableBuffer = DataFrameBuffer.GetMutableBuffer(resultBuffer); + resultContainer.Buffers[b] = resultMutableBuffer; + Span resultSpan = resultMutableBuffer.Span; + DataFrameBuffer resultMutableNullBitMapBuffer = DataFrameBuffer.GetMutableBuffer(resultContainer.NullBitMapBuffers[b]); + resultContainer.NullBitMapBuffers[b] = resultMutableNullBitMapBuffer; + Span resultNullBitMapSpan = resultMutableNullBitMapBuffer.Span; + + for (int i = 0; i < span.Length; i++) + { + long curIndex = i + prevLength; + bool isValid = IsValid(nullBitMapSpan, i); + TResult? value = func(isValid ? span[i] : default(T?)); + resultSpan[i] = value.GetValueOrDefault(); + SetValidityBit(resultNullBitMapSpan, i, value != null); + } + } + } + + // Faster to use when we already have a span since it avoids indexing + public bool IsValid(ReadOnlySpan bitMapBufferSpan, int index) + { + int nullBitMapSpanIndex = index / 8; + byte thisBitMap = bitMapBufferSpan[nullBitMapSpanIndex]; + return IsBitSet(thisBitMap, index); + } + + public bool IsValid(long index) => NullCount == 0 || GetValidityBit(index); + + private byte SetBit(byte curBitMap, int index, bool value) + { + byte newBitMap; + if (value) + { + newBitMap = (byte)(curBitMap | (byte)(1 << (index & 7))); //bit hack for index % 8 + if (_modifyNullCountWhileIndexing && ((curBitMap >> (index & 7)) & 1) == 0 && index < Length && NullCount > 0) + { + // Old value was null. + NullCount--; + } + } + else + { + if (_modifyNullCountWhileIndexing && ((curBitMap >> (index & 7)) & 1) == 1 && index < Length) + { + // old value was NOT null and new value is null + NullCount++; + } + else if (_modifyNullCountWhileIndexing && index == Length) + { + // New entry from an append + NullCount++; + } + newBitMap = (byte)(curBitMap & (byte)~(1 << (int)((uint)index & 7))); + } + return newBitMap; + } + + // private function. Faster to use when we already have a span since it avoids indexing + private void SetValidityBit(Span bitMapBufferSpan, int index, bool value) + { + int bitMapBufferIndex = (int)((uint)index / 8); + Debug.Assert(bitMapBufferSpan.Length >= bitMapBufferIndex); + byte curBitMap = bitMapBufferSpan[bitMapBufferIndex]; + byte newBitMap = SetBit(curBitMap, index, value); + bitMapBufferSpan[bitMapBufferIndex] = newBitMap; + } + + /// + /// A null value has an unset bit + /// A NON-null value has a set bit + /// + /// + /// + internal void SetValidityBit(long index, bool value) + { + if ((ulong)index > (ulong)Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + // First find the right bitMapBuffer + int bitMapIndex = (int)(index / ReadOnlyDataFrameBuffer.MaxCapacity); + Debug.Assert(NullBitMapBuffers.Count > bitMapIndex); + DataFrameBuffer bitMapBuffer = (DataFrameBuffer)NullBitMapBuffers[bitMapIndex]; + + // Set the bit + index -= bitMapIndex * ReadOnlyDataFrameBuffer.MaxCapacity; + int bitMapBufferIndex = (int)((uint)index / 8); + Debug.Assert(bitMapBuffer.Length >= bitMapBufferIndex); + if (bitMapBuffer.Length == bitMapBufferIndex) + bitMapBuffer.Append(0); + SetValidityBit(bitMapBuffer.Span, (int)index, value); + } + + private bool IsBitSet(byte curBitMap, int index) + { + return ((curBitMap >> (index & 7)) & 1) != 0; + } + + private bool GetValidityBit(long index) + { + if ((uint)index >= Length) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + // First find the right bitMapBuffer + int bitMapIndex = (int)(index / ReadOnlyDataFrameBuffer.MaxCapacity); + Debug.Assert(NullBitMapBuffers.Count > bitMapIndex); + ReadOnlyDataFrameBuffer bitMapBuffer = NullBitMapBuffers[bitMapIndex]; + + // Get the bit + index -= bitMapIndex * ReadOnlyDataFrameBuffer.MaxCapacity; + int bitMapBufferIndex = (int)((uint)index / 8); + Debug.Assert(bitMapBuffer.Length > bitMapBufferIndex); + byte curBitMap = bitMapBuffer[bitMapBufferIndex]; + return IsBitSet(curBitMap, (int)index); + } + + public long Length; + + public long NullCount; + public int GetArrayContainingRowIndex(long rowIndex) + { + if (rowIndex >= Length) + { + throw new ArgumentOutOfRangeException(Strings.ColumnIndexOutOfRange, nameof(rowIndex)); + } + return (int)(rowIndex / ReadOnlyDataFrameBuffer.MaxCapacity); + } + + internal int MaxRecordBatchLength(long startIndex) + { + if (Length == 0) + return 0; + int arrayIndex = GetArrayContainingRowIndex(startIndex); + startIndex = startIndex - arrayIndex * ReadOnlyDataFrameBuffer.MaxCapacity; + return Buffers[arrayIndex].Length - (int)startIndex; + } + + internal ReadOnlyMemory GetValueBuffer(long startIndex) + { + int arrayIndex = GetArrayContainingRowIndex(startIndex); + return Buffers[arrayIndex].ReadOnlyBuffer; + } + + internal ReadOnlyMemory GetNullBuffer(long startIndex) + { + int arrayIndex = GetArrayContainingRowIndex(startIndex); + return NullBitMapBuffers[arrayIndex].ReadOnlyBuffer; + } + + public IReadOnlyList this[long startIndex, int length] + { + get + { + var ret = new List(length); + long endIndex = Math.Min(Length, startIndex + length); + for (long i = startIndex; i < endIndex; i++) + { + ret.Add(this[i]); + } + return ret; + } + } + + public T? this[long rowIndex] + { + get + { + if (!IsValid(rowIndex)) + { + return null; + } + int arrayIndex = GetArrayContainingRowIndex(rowIndex); + rowIndex = rowIndex - arrayIndex * ReadOnlyDataFrameBuffer.MaxCapacity; + return Buffers[arrayIndex][(int)rowIndex]; + } + set + { + int arrayIndex = GetArrayContainingRowIndex(rowIndex); + rowIndex = rowIndex - arrayIndex * ReadOnlyDataFrameBuffer.MaxCapacity; + ReadOnlyDataFrameBuffer buffer = Buffers[arrayIndex]; + DataFrameBuffer mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + Buffers[arrayIndex] = mutableBuffer; + DataFrameBuffer mutableNullBuffer = DataFrameBuffer.GetMutableBuffer(NullBitMapBuffers[arrayIndex]); + NullBitMapBuffers[arrayIndex] = mutableNullBuffer; + if (value.HasValue) + { + Buffers[arrayIndex][(int)rowIndex] = value.Value; + SetValidityBit(rowIndex, true); + } + else + { + Buffers[arrayIndex][(int)rowIndex] = default; + SetValidityBit(rowIndex, false); + } + } + } + + public IEnumerator GetEnumerator() + { + for (long i = 0; i < Length; i++) + { + yield return this[i]; + } + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < Length; i++) + { + T? value = this[i]; + if (value.HasValue) + { + sb.Append(this[i]).Append(" "); + } + else + { + sb.Append("null").Append(" "); + } + // Can this run out of memory? Just being safe here + if (sb.Length > 1000) + { + sb.Append("..."); + break; + } + } + return sb.ToString(); + } + + private List> CloneNullBitMapBuffers() + { + List> ret = new List>(); + foreach (ReadOnlyDataFrameBuffer buffer in NullBitMapBuffers) + { + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Add(newBuffer); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(span[i]); + } + } + return ret; + } + + public PrimitiveColumnContainer Clone(PrimitiveColumnContainer mapIndices, Type type, bool invertMapIndices = false) + where U : unmanaged + { + ReadOnlySpan thisSpan = Buffers[0].ReadOnlySpan; + ReadOnlySpan thisNullBitMapSpan = NullBitMapBuffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = DataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + PrimitiveColumnContainer ret = new PrimitiveColumnContainer(mapIndices.Length); + for (int b = 0; b < mapIndices.Buffers.Count; b++) + { + int index = b; + if (invertMapIndices) + index = mapIndices.Buffers.Count - 1 - b; + + ReadOnlyDataFrameBuffer buffer = mapIndices.Buffers[index]; + ReadOnlySpan mapIndicesNullBitMapSpan = mapIndices.NullBitMapBuffers[index].ReadOnlySpan; + ReadOnlySpan mapIndicesSpan = buffer.ReadOnlySpan; + ReadOnlySpan mapIndicesLongSpan = default; + ReadOnlySpan mapIndicesIntSpan = default; + DataFrameBuffer mutableBuffer = DataFrameBuffer.GetMutableBuffer(ret.Buffers[index]); + ret.Buffers[index] = mutableBuffer; + Span retSpan = mutableBuffer.Span; + DataFrameBuffer mutableNullBuffer = DataFrameBuffer.GetMutableBuffer(ret.NullBitMapBuffers[index]); + ret.NullBitMapBuffers[index] = mutableNullBuffer; + Span retNullBitMapSpan = mutableNullBuffer.Span; + if (type == typeof(long)) + { + mapIndicesLongSpan = MemoryMarshal.Cast(mapIndicesSpan); + } + if (type == typeof(int)) + { + mapIndicesIntSpan = MemoryMarshal.Cast(mapIndicesSpan); + } + for (int i = 0; i < buffer.Length; i++) + { + int spanIndex = i; + if (invertMapIndices) + spanIndex = buffer.Length - 1 - i; + + long mapRowIndex = mapIndicesIntSpan.IsEmpty ? mapIndicesLongSpan[spanIndex] : mapIndicesIntSpan[spanIndex]; + bool mapRowIndexIsValid = mapIndices.IsValid(mapIndicesNullBitMapSpan, spanIndex); + if (mapRowIndexIsValid && (mapRowIndex < minRange || mapRowIndex >= maxRange)) + { + int bufferIndex = (int)(mapRowIndex / maxCapacity); + thisSpan = Buffers[bufferIndex].ReadOnlySpan; + thisNullBitMapSpan = NullBitMapBuffers[bufferIndex].ReadOnlySpan; + minRange = bufferIndex * maxCapacity; + maxRange = (bufferIndex + 1) * maxCapacity; + } + T value = default; + bool isValid = false; + if (mapRowIndexIsValid) + { + mapRowIndex -= minRange; + value = thisSpan[(int)mapRowIndex]; + isValid = IsValid(thisNullBitMapSpan, (int)mapRowIndex); + } + + retSpan[i] = isValid ? value : default; + ret.SetValidityBit(retNullBitMapSpan, i, isValid); + } + } + return ret; + } + + public PrimitiveColumnContainer Clone() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + ReadOnlySpan span = buffer.ReadOnlySpan; + ret.Length += buffer.Length; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(span[i]); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsBoolContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + if (typeof(T) == typeof(bool)) + { + var localBuffer = buffer; + ReadOnlyDataFrameBuffer boolLocalBuffer = Unsafe.As, ReadOnlyDataFrameBuffer>(ref localBuffer); + boolLocalBuffer.ReadOnlySpan.TryCopyTo(newBuffer.RawSpan); + } + else + { + newBuffer.Span.Fill(false); + } + newBuffer.Length = buffer.Length; + ret.Length += buffer.Length; + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsByteContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(ByteConverter.Instance.GetByte(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsSByteContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(SByteConverter.Instance.GetSByte(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsDoubleContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(DoubleConverter.Instance.GetDouble(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsDecimalContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(DecimalConverter.Instance.GetDecimal(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsShortContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(Int16Converter.Instance.GetInt16(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsUShortContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(UInt16Converter.Instance.GetUInt16(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsIntContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(Int32Converter.Instance.GetInt32(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsUIntContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(UInt32Converter.Instance.GetUInt32(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsLongContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(Int64Converter.Instance.GetInt64(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsULongContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(UInt64Converter.Instance.GetUInt64(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + + internal PrimitiveColumnContainer CloneAsFloatContainer() + { + var ret = new PrimitiveColumnContainer(); + foreach (ReadOnlyDataFrameBuffer buffer in Buffers) + { + ret.Length += buffer.Length; + DataFrameBuffer newBuffer = new DataFrameBuffer(); + ret.Buffers.Add(newBuffer); + newBuffer.EnsureCapacity(buffer.Length); + ReadOnlySpan span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + newBuffer.Append(SingleConverter.Instance.GetSingle(span[i])); + } + } + ret.NullBitMapBuffers = CloneNullBitMapBuffers(); + ret.NullCount = NullCount; + return ret; + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs new file mode 100644 index 0000000000..51258d1d77 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.cs @@ -0,0 +1,15832 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public partial class ByteDataFrameColumn + { + public Int32DataFrameColumn Add(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Divide(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Add(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public UInt32DataFrameColumn Add(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.AddImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Subtract(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.SubtractImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Multiply(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.MultiplyImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Divide(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.DivideImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Modulo(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ModuloImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Add(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.AddImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Subtract(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.SubtractImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Multiply(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.MultiplyImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Divide(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.DivideImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Modulo(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + } + public partial class DecimalDataFrameColumn + { + public DecimalDataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public DecimalDataFrameColumn Add(Int32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(Int32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(Int32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(Int32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(Int32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(Int64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(Int64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(Int64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(Int64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(Int64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(SByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(SByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(SByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(SByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(SByteDataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(Int16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(Int16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(Int16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(Int16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(Int16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(UInt32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(UInt32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(UInt32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(UInt32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(UInt32DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(UInt64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(UInt64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(UInt64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(UInt64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(UInt64DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return AddImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return SubtractImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return MultiplyImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return DivideImplementation(otherdecimalColumn, inPlace); + } + public DecimalDataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ModuloImplementation(otherdecimalColumn, inPlace); + } + } + public partial class DoubleDataFrameColumn + { + public DoubleDataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public DoubleDataFrameColumn Add(SingleDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(SingleDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(SingleDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(SingleDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(SingleDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(Int32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(Int32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(Int32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(Int32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(Int32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(Int64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(Int64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(Int64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(Int64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(Int64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(SByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(SByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(SByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(SByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(SByteDataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(Int16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(Int16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(Int16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(Int16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(Int16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(UInt32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(UInt32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(UInt32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(UInt32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(UInt32DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(UInt64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(UInt64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(UInt64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(UInt64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(UInt64DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return AddImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return SubtractImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return MultiplyImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return DivideImplementation(otherdoubleColumn, inPlace); + } + public DoubleDataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ModuloImplementation(otherdoubleColumn, inPlace); + } + } + public partial class SingleDataFrameColumn + { + public SingleDataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public SingleDataFrameColumn Add(Int32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(Int32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(Int32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(Int32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(Int32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Add(Int64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(Int64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(Int64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(Int64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(Int64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Add(SByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(SByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(SByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(SByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(SByteDataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Add(Int16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(Int16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(Int16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(Int16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(Int16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Add(UInt32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(UInt32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(UInt32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(UInt32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(UInt32DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Add(UInt64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(UInt64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(UInt64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(UInt64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(UInt64DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return AddImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return SubtractImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return MultiplyImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return DivideImplementation(otherfloatColumn, inPlace); + } + public SingleDataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ModuloImplementation(otherfloatColumn, inPlace); + } + } + public partial class Int32DataFrameColumn + { + public Int32DataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return AddImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return SubtractImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return MultiplyImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return DivideImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ModuloImplementation(otherintColumn, inPlace); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(Int32DataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public Int32DataFrameColumn Subtract(Int32DataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public Int32DataFrameColumn Multiply(Int32DataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public Int32DataFrameColumn Divide(Int32DataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public Int32DataFrameColumn Modulo(Int32DataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(SByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return AddImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Subtract(SByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return SubtractImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Multiply(SByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return MultiplyImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Divide(SByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return DivideImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Modulo(SByteDataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ModuloImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Add(Int16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return AddImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Subtract(Int16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return SubtractImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Multiply(Int16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return MultiplyImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Divide(Int16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return DivideImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Modulo(Int16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ModuloImplementation(otherintColumn, inPlace); + } + public Int64DataFrameColumn Add(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.AddImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Subtract(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.SubtractImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Multiply(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.MultiplyImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Divide(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.DivideImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Modulo(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.ModuloImplementation(otherlongColumn, inPlace: true); + } + public SingleDataFrameColumn Add(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.AddImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Subtract(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Multiply(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Divide(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.DivideImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Modulo(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(otherfloatColumn, inPlace: true); + } + public Int32DataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return AddImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return SubtractImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return MultiplyImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return DivideImplementation(otherintColumn, inPlace); + } + public Int32DataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ModuloImplementation(otherintColumn, inPlace); + } + } + public partial class Int64DataFrameColumn + { + public Int64DataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return AddImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return SubtractImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return MultiplyImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return DivideImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ModuloImplementation(otherlongColumn, inPlace); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(Int32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return AddImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Subtract(Int32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return SubtractImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Multiply(Int32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return MultiplyImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Divide(Int32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return DivideImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Modulo(Int32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ModuloImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public Int64DataFrameColumn Add(SByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return AddImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Subtract(SByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return SubtractImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Multiply(SByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return MultiplyImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Divide(SByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return DivideImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Modulo(SByteDataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ModuloImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Add(Int16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return AddImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Subtract(Int16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return SubtractImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Multiply(Int16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return MultiplyImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Divide(Int16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return DivideImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Modulo(Int16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ModuloImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Add(UInt32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return AddImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Subtract(UInt32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return SubtractImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Multiply(UInt32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return MultiplyImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Divide(UInt32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return DivideImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Modulo(UInt32DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ModuloImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return AddImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return SubtractImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return MultiplyImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return DivideImplementation(otherlongColumn, inPlace); + } + public Int64DataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ModuloImplementation(otherlongColumn, inPlace); + } + } + public partial class SByteDataFrameColumn + { + public Int32DataFrameColumn Add(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Divide(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Add(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public Int64DataFrameColumn Add(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.AddImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Subtract(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.SubtractImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Multiply(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.MultiplyImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Divide(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.DivideImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Modulo(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.ModuloImplementation(otherlongColumn, inPlace: true); + } + public SingleDataFrameColumn Add(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.AddImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Subtract(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Multiply(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Divide(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.DivideImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Modulo(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(otherfloatColumn, inPlace: true); + } + public Int32DataFrameColumn Add(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + } + public partial class Int16DataFrameColumn + { + public Int32DataFrameColumn Add(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Divide(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Add(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public Int64DataFrameColumn Add(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.AddImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Subtract(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.SubtractImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Multiply(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.MultiplyImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Divide(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.DivideImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Modulo(UInt32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.ModuloImplementation(otherlongColumn, inPlace: true); + } + public SingleDataFrameColumn Add(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.AddImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Subtract(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Multiply(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Divide(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.DivideImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Modulo(UInt64DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(otherfloatColumn, inPlace: true); + } + public Int32DataFrameColumn Add(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + } + public partial class UInt32DataFrameColumn + { + public UInt32DataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return AddImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return SubtractImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return MultiplyImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return DivideImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ModuloImplementation(otheruintColumn, inPlace); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(Int32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.AddImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.SubtractImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.MultiplyImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Divide(Int32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.DivideImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int32DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.ModuloImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(SByteDataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.AddImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Subtract(SByteDataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.SubtractImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Multiply(SByteDataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.MultiplyImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Divide(SByteDataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.DivideImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Modulo(SByteDataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.ModuloImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Add(Int16DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.AddImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int16DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.SubtractImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int16DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.MultiplyImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Divide(Int16DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.DivideImplementation(otherlongColumn, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int16DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return longColumn.ModuloImplementation(otherlongColumn, inPlace: true); + } + public UInt32DataFrameColumn Add(UInt32DataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public UInt32DataFrameColumn Subtract(UInt32DataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public UInt32DataFrameColumn Multiply(UInt32DataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public UInt32DataFrameColumn Divide(UInt32DataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public UInt32DataFrameColumn Modulo(UInt32DataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public UInt64DataFrameColumn Add(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.AddImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Subtract(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.SubtractImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Multiply(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.MultiplyImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Divide(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.DivideImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Modulo(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ModuloImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return AddImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return SubtractImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return MultiplyImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return DivideImplementation(otheruintColumn, inPlace); + } + public UInt32DataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ModuloImplementation(otheruintColumn, inPlace); + } + } + public partial class UInt64DataFrameColumn + { + public UInt64DataFrameColumn Add(ByteDataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return AddImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Subtract(ByteDataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return SubtractImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Multiply(ByteDataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return MultiplyImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Divide(ByteDataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return DivideImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Modulo(ByteDataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ModuloImplementation(otherulongColumn, inPlace); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(Int32DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.AddImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Subtract(Int32DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Multiply(Int32DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Divide(Int32DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.DivideImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Modulo(Int32DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Add(SByteDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.AddImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Subtract(SByteDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Multiply(SByteDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Divide(SByteDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.DivideImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Modulo(SByteDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Add(Int16DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.AddImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Subtract(Int16DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Multiply(Int16DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Divide(Int16DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.DivideImplementation(otherfloatColumn, inPlace: true); + } + public SingleDataFrameColumn Modulo(Int16DataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(otherfloatColumn, inPlace: true); + } + public UInt64DataFrameColumn Add(UInt32DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return AddImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Subtract(UInt32DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return SubtractImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Multiply(UInt32DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return MultiplyImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Divide(UInt32DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return DivideImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Modulo(UInt32DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ModuloImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Add(UInt64DataFrameColumn column, bool inPlace = false) + { + return AddImplementation(column, inPlace); + } + public UInt64DataFrameColumn Subtract(UInt64DataFrameColumn column, bool inPlace = false) + { + return SubtractImplementation(column, inPlace); + } + public UInt64DataFrameColumn Multiply(UInt64DataFrameColumn column, bool inPlace = false) + { + return MultiplyImplementation(column, inPlace); + } + public UInt64DataFrameColumn Divide(UInt64DataFrameColumn column, bool inPlace = false) + { + return DivideImplementation(column, inPlace); + } + public UInt64DataFrameColumn Modulo(UInt64DataFrameColumn column, bool inPlace = false) + { + return ModuloImplementation(column, inPlace); + } + public UInt64DataFrameColumn Add(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return AddImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Subtract(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return SubtractImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Multiply(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return MultiplyImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Divide(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return DivideImplementation(otherulongColumn, inPlace); + } + public UInt64DataFrameColumn Modulo(UInt16DataFrameColumn column, bool inPlace = false) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ModuloImplementation(otherulongColumn, inPlace); + } + } + public partial class UInt16DataFrameColumn + { + public Int32DataFrameColumn Add(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(ByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public DecimalDataFrameColumn Add(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Subtract(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Multiply(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Divide(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(column, inPlace: true); + } + public DecimalDataFrameColumn Modulo(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Add(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Subtract(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Multiply(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Divide(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(column, inPlace: true); + } + public DoubleDataFrameColumn Modulo(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Add(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Subtract(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Multiply(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Divide(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(column, inPlace: true); + } + public SingleDataFrameColumn Modulo(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Divide(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Add(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Subtract(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Multiply(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Divide(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(column, inPlace: true); + } + public Int64DataFrameColumn Modulo(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(SByteDataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Add(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(Int16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + public UInt32DataFrameColumn Add(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.AddImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Subtract(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.SubtractImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Multiply(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.MultiplyImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Divide(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.DivideImplementation(column, inPlace: true); + } + public UInt32DataFrameColumn Modulo(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ModuloImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Add(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.AddImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Subtract(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.SubtractImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Multiply(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.MultiplyImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Divide(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.DivideImplementation(column, inPlace: true); + } + public UInt64DataFrameColumn Modulo(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ModuloImplementation(column, inPlace: true); + } + public Int32DataFrameColumn Add(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.AddImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Subtract(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.SubtractImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Multiply(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.MultiplyImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Divide(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.DivideImplementation(otherintColumn, inPlace: true); + } + public Int32DataFrameColumn Modulo(UInt16DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return intColumn.ModuloImplementation(otherintColumn, inPlace: true); + } + } + public partial class ByteDataFrameColumn + { + public Int32DataFrameColumn Add(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Add(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.AddImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseAdd(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseAddImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Subtract(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.SubtractImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseSubtract(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Multiply(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.MultiplyImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseMultiply(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Divide(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.DivideImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseDivide(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseDivideImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Modulo(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ModuloImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseModulo(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Add(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.AddImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseAdd(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseAddImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Subtract(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.SubtractImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseSubtract(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Multiply(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.MultiplyImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseMultiply(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Divide(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.DivideImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseDivide(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseDivideImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Modulo(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ModuloImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseModulo(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + } + public partial class DecimalDataFrameColumn + { + public DecimalDataFrameColumn Add(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(decimal value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(decimal value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public DecimalDataFrameColumn Subtract(decimal value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public DecimalDataFrameColumn Multiply(decimal value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public DecimalDataFrameColumn Divide(decimal value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(decimal value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public DecimalDataFrameColumn Modulo(decimal value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(decimal value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public DecimalDataFrameColumn Add(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(int value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(long value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(sbyte value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(short value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(uint value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(ulong value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return AddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Subtract(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Multiply(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Divide(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return DivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Modulo(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + decimal convertedValue = (decimal)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class DoubleDataFrameColumn + { + public DoubleDataFrameColumn Add(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(double value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(double value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public DoubleDataFrameColumn Subtract(double value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(double value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public DoubleDataFrameColumn Multiply(double value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(double value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public DoubleDataFrameColumn Divide(double value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(double value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public DoubleDataFrameColumn Modulo(double value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(double value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public DoubleDataFrameColumn Add(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(float value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(int value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(long value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(sbyte value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(short value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(uint value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(ulong value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return AddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Subtract(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return SubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Multiply(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Divide(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return DivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Modulo(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return ModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + double convertedValue = (double)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class SingleDataFrameColumn + { + public SingleDataFrameColumn Add(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public SingleDataFrameColumn ReverseAdd(float value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public SingleDataFrameColumn Subtract(float value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(float value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public SingleDataFrameColumn Multiply(float value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(float value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public SingleDataFrameColumn Divide(float value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public SingleDataFrameColumn ReverseDivide(float value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public SingleDataFrameColumn Modulo(float value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public SingleDataFrameColumn ReverseModulo(float value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public SingleDataFrameColumn Add(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(int value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Add(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(long value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Add(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(sbyte value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Add(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(short value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Add(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(uint value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Add(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(ulong value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Add(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return AddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Subtract(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return SubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Multiply(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Divide(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return DivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn Modulo(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return ModuloImplementation(convertedValue, inPlace); + } + public SingleDataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + float convertedValue = (float)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class Int32DataFrameColumn + { + public Int32DataFrameColumn Add(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return AddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Subtract(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Multiply(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Divide(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Modulo(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(int value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public Int32DataFrameColumn ReverseAdd(int value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public Int32DataFrameColumn Subtract(int value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public Int32DataFrameColumn ReverseSubtract(int value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public Int32DataFrameColumn Multiply(int value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public Int32DataFrameColumn ReverseMultiply(int value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public Int32DataFrameColumn Divide(int value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public Int32DataFrameColumn ReverseDivide(int value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public Int32DataFrameColumn Modulo(int value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public Int32DataFrameColumn ReverseModulo(int value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public Int64DataFrameColumn Add(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return AddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseAdd(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Subtract(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseSubtract(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Multiply(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseMultiply(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Divide(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseDivide(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Modulo(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseModulo(sbyte value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Add(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return AddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseAdd(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Subtract(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseSubtract(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Multiply(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseMultiply(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Divide(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseDivide(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Modulo(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseModulo(short value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Add(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return AddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Subtract(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Multiply(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Divide(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn Modulo(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int32DataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + int convertedValue = (int)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class Int64DataFrameColumn + { + public Int64DataFrameColumn Add(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return AddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Subtract(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Multiply(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Divide(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Modulo(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return AddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseAdd(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Subtract(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Multiply(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Divide(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseDivide(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Modulo(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseModulo(int value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Add(long value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public Int64DataFrameColumn ReverseAdd(long value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public Int64DataFrameColumn Subtract(long value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(long value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public Int64DataFrameColumn Multiply(long value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(long value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public Int64DataFrameColumn Divide(long value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public Int64DataFrameColumn ReverseDivide(long value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public Int64DataFrameColumn Modulo(long value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public Int64DataFrameColumn ReverseModulo(long value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public Int64DataFrameColumn Add(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return AddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseAdd(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Subtract(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Multiply(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Divide(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseDivide(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Modulo(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseModulo(sbyte value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Add(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return AddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseAdd(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Subtract(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Multiply(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Divide(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseDivide(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Modulo(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseModulo(short value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Add(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return AddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseAdd(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Subtract(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Multiply(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Divide(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseDivide(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Modulo(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseModulo(uint value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Add(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return AddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Subtract(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return SubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Multiply(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Divide(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return DivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn Modulo(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return ModuloImplementation(convertedValue, inPlace); + } + public Int64DataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + long convertedValue = (long)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class SByteDataFrameColumn + { + public Int32DataFrameColumn Add(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + } + public partial class Int16DataFrameColumn + { + public Int32DataFrameColumn Add(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(uint value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(ulong value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + } + public partial class UInt32DataFrameColumn + { + public UInt32DataFrameColumn Add(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return AddImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Subtract(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return SubtractImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Multiply(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Divide(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return DivideImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Modulo(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ModuloImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(int value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(sbyte value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(short value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Add(uint value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public UInt32DataFrameColumn ReverseAdd(uint value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public UInt32DataFrameColumn Subtract(uint value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public UInt32DataFrameColumn ReverseSubtract(uint value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public UInt32DataFrameColumn Multiply(uint value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public UInt32DataFrameColumn ReverseMultiply(uint value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public UInt32DataFrameColumn Divide(uint value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public UInt32DataFrameColumn ReverseDivide(uint value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public UInt32DataFrameColumn Modulo(uint value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public UInt32DataFrameColumn ReverseModulo(uint value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public UInt64DataFrameColumn Add(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.AddImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseAdd(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseAddImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Subtract(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.SubtractImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseSubtract(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Multiply(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.MultiplyImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseMultiply(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Divide(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.DivideImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseDivide(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseDivideImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Modulo(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ModuloImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseModulo(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Add(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return AddImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Subtract(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return SubtractImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Multiply(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Divide(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return DivideImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn Modulo(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ModuloImplementation(convertedValue, inPlace); + } + public UInt32DataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + uint convertedValue = (uint)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class UInt64DataFrameColumn + { + public UInt64DataFrameColumn Add(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return AddImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseAdd(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Subtract(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return SubtractImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseSubtract(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Multiply(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseMultiply(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Divide(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return DivideImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseDivide(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Modulo(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ModuloImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseModulo(byte value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(int value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(sbyte value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(short value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Add(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return AddImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseAdd(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Subtract(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return SubtractImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseSubtract(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Multiply(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseMultiply(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Divide(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return DivideImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseDivide(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Modulo(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ModuloImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseModulo(uint value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Add(ulong value, bool inPlace = false) + { + return AddImplementation(value, inPlace); + } + public UInt64DataFrameColumn ReverseAdd(ulong value, bool inPlace = false) + { + return ReverseAddImplementation(value, inPlace); + } + public UInt64DataFrameColumn Subtract(ulong value, bool inPlace = false) + { + return SubtractImplementation(value, inPlace); + } + public UInt64DataFrameColumn ReverseSubtract(ulong value, bool inPlace = false) + { + return ReverseSubtractImplementation(value, inPlace); + } + public UInt64DataFrameColumn Multiply(ulong value, bool inPlace = false) + { + return MultiplyImplementation(value, inPlace); + } + public UInt64DataFrameColumn ReverseMultiply(ulong value, bool inPlace = false) + { + return ReverseMultiplyImplementation(value, inPlace); + } + public UInt64DataFrameColumn Divide(ulong value, bool inPlace = false) + { + return DivideImplementation(value, inPlace); + } + public UInt64DataFrameColumn ReverseDivide(ulong value, bool inPlace = false) + { + return ReverseDivideImplementation(value, inPlace); + } + public UInt64DataFrameColumn Modulo(ulong value, bool inPlace = false) + { + return ModuloImplementation(value, inPlace); + } + public UInt64DataFrameColumn ReverseModulo(ulong value, bool inPlace = false) + { + return ReverseModuloImplementation(value, inPlace); + } + public UInt64DataFrameColumn Add(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return AddImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseAdd(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseAddImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Subtract(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return SubtractImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseSubtract(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseSubtractImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Multiply(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return MultiplyImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseMultiply(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseMultiplyImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Divide(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return DivideImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseDivide(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseDivideImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn Modulo(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ModuloImplementation(convertedValue, inPlace); + } + public UInt64DataFrameColumn ReverseModulo(ushort value, bool inPlace = false) + { + ulong convertedValue = (ulong)value; + return ReverseModuloImplementation(convertedValue, inPlace); + } + } + public partial class UInt16DataFrameColumn + { + public Int32DataFrameColumn Add(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(byte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Add(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.AddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseAdd(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseAddImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Subtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.SubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseSubtract(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Multiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.MultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseMultiply(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Divide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.DivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseDivide(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn Modulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ModuloImplementation(value, inPlace: true); + } + public DecimalDataFrameColumn ReverseModulo(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ReverseModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Add(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.AddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseAdd(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseAddImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Subtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.SubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseSubtract(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Multiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.MultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseMultiply(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Divide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.DivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseDivide(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseDivideImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn Modulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ModuloImplementation(value, inPlace: true); + } + public DoubleDataFrameColumn ReverseModulo(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ReverseModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Add(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.AddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseAdd(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseAddImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Subtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.SubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseSubtract(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Multiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.MultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseMultiply(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Divide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.DivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseDivide(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseDivideImplementation(value, inPlace: true); + } + public SingleDataFrameColumn Modulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ModuloImplementation(value, inPlace: true); + } + public SingleDataFrameColumn ReverseModulo(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Add(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.AddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseAdd(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Subtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.SubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseSubtract(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Multiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.MultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseMultiply(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Divide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.DivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseDivide(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int64DataFrameColumn Modulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ModuloImplementation(value, inPlace: true); + } + public Int64DataFrameColumn ReverseModulo(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(sbyte value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(short value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Add(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.AddImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseAdd(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseAddImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Subtract(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.SubtractImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseSubtract(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Multiply(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.MultiplyImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseMultiply(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Divide(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.DivideImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseDivide(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseDivideImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn Modulo(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ModuloImplementation(value, inPlace: true); + } + public UInt32DataFrameColumn ReverseModulo(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ReverseModuloImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Add(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.AddImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseAdd(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseAddImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Subtract(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.SubtractImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseSubtract(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Multiply(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.MultiplyImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseMultiply(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Divide(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.DivideImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseDivide(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseDivideImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn Modulo(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ModuloImplementation(value, inPlace: true); + } + public UInt64DataFrameColumn ReverseModulo(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ReverseModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Add(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.AddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseAdd(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseAddImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Subtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.SubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseSubtract(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseSubtractImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Multiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.MultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseMultiply(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseMultiplyImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Divide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.DivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseDivide(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseDivideImplementation(value, inPlace: true); + } + public Int32DataFrameColumn Modulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ModuloImplementation(value, inPlace: true); + } + public Int32DataFrameColumn ReverseModulo(ushort value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ReverseModuloImplementation(value, inPlace: true); + } + } + public partial class BooleanDataFrameColumn + { + public BooleanDataFrameColumn And(BooleanDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.And(column.ColumnContainer); + return retColumn; + } + } + public partial class BooleanDataFrameColumn + { + public new BooleanDataFrameColumn And(bool value, bool inPlace = false) + { + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.And(value); + return retColumn; + } + } + public partial class BooleanDataFrameColumn + { + public BooleanDataFrameColumn Or(BooleanDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.Or(column.ColumnContainer); + return retColumn; + } + } + public partial class BooleanDataFrameColumn + { + public new BooleanDataFrameColumn Or(bool value, bool inPlace = false) + { + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.Or(value); + return retColumn; + } + } + public partial class BooleanDataFrameColumn + { + public BooleanDataFrameColumn Xor(BooleanDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.Xor(column.ColumnContainer); + return retColumn; + } + } + public partial class BooleanDataFrameColumn + { + public new BooleanDataFrameColumn Xor(bool value, bool inPlace = false) + { + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.Xor(value); + return retColumn; + } + } + + public partial class BooleanDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(BooleanDataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(BooleanDataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(BooleanDataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(BooleanDataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(BooleanDataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(BooleanDataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + } + public partial class ByteDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + ByteDataFrameColumn otherbyteColumn = column.CloneAsByteColumn(); + return ElementwiseEqualsImplementation(otherbyteColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + ByteDataFrameColumn otherbyteColumn = column.CloneAsByteColumn(); + return ElementwiseNotEqualsImplementation(otherbyteColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + ByteDataFrameColumn otherbyteColumn = column.CloneAsByteColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherbyteColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + ByteDataFrameColumn otherbyteColumn = column.CloneAsByteColumn(); + return ElementwiseLessThanOrEqualImplementation(otherbyteColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + ByteDataFrameColumn otherbyteColumn = column.CloneAsByteColumn(); + return ElementwiseGreaterThanImplementation(otherbyteColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + ByteDataFrameColumn otherbyteColumn = column.CloneAsByteColumn(); + return ElementwiseLessThanImplementation(otherbyteColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanImplementation(column); + } + } + public partial class DecimalDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseNotEqualsImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseGreaterThanImplementation(otherdecimalColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + DecimalDataFrameColumn otherdecimalColumn = column.CloneAsDecimalColumn(); + return ElementwiseLessThanImplementation(otherdecimalColumn); + } + } + public partial class DoubleDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseNotEqualsImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseGreaterThanImplementation(otherdoubleColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + DoubleDataFrameColumn otherdoubleColumn = column.CloneAsDoubleColumn(); + return ElementwiseLessThanImplementation(otherdoubleColumn); + } + } + public partial class SingleDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseNotEqualsImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanOrEqualImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseGreaterThanImplementation(otherfloatColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + SingleDataFrameColumn otherfloatColumn = column.CloneAsSingleColumn(); + return ElementwiseLessThanImplementation(otherfloatColumn); + } + } + public partial class Int32DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseNotEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseNotEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseNotEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseNotEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseNotEqualsImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseGreaterThanImplementation(otherintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + Int32DataFrameColumn otherintColumn = column.CloneAsInt32Column(); + return ElementwiseLessThanImplementation(otherintColumn); + } + } + public partial class Int64DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseNotEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseNotEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseNotEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseNotEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseNotEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseNotEqualsImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseGreaterThanImplementation(otherlongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + Int64DataFrameColumn otherlongColumn = column.CloneAsInt64Column(); + return ElementwiseLessThanImplementation(otherlongColumn); + } + } + public partial class SByteDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + SByteDataFrameColumn othersbyteColumn = column.CloneAsSByteColumn(); + return ElementwiseEqualsImplementation(othersbyteColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + SByteDataFrameColumn othersbyteColumn = column.CloneAsSByteColumn(); + return ElementwiseNotEqualsImplementation(othersbyteColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + SByteDataFrameColumn othersbyteColumn = column.CloneAsSByteColumn(); + return ElementwiseGreaterThanOrEqualImplementation(othersbyteColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + SByteDataFrameColumn othersbyteColumn = column.CloneAsSByteColumn(); + return ElementwiseLessThanOrEqualImplementation(othersbyteColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + SByteDataFrameColumn othersbyteColumn = column.CloneAsSByteColumn(); + return ElementwiseGreaterThanImplementation(othersbyteColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + SByteDataFrameColumn othersbyteColumn = column.CloneAsSByteColumn(); + return ElementwiseLessThanImplementation(othersbyteColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanImplementation(column); + } + } + public partial class Int16DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseEqualsImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseNotEqualsImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseGreaterThanOrEqualImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseLessThanOrEqualImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseGreaterThanImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseLessThanImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseEqualsImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseNotEqualsImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseGreaterThanOrEqualImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseLessThanOrEqualImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseGreaterThanImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseLessThanImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseEqualsImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseNotEqualsImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseGreaterThanOrEqualImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseLessThanOrEqualImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseGreaterThanImplementation(othershortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + Int16DataFrameColumn othershortColumn = column.CloneAsInt16Column(); + return ElementwiseLessThanImplementation(othershortColumn); + } + } + public partial class UInt32DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseNotEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseNotEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseNotEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseNotEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseNotEqualsImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanOrEqualImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseGreaterThanImplementation(otheruintColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + UInt32DataFrameColumn otheruintColumn = column.CloneAsUInt32Column(); + return ElementwiseLessThanImplementation(otheruintColumn); + } + } + public partial class UInt64DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseNotEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseNotEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseNotEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseNotEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseNotEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseNotEqualsImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanOrEqualImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseGreaterThanImplementation(otherulongColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + UInt64DataFrameColumn otherulongColumn = column.CloneAsUInt64Column(); + return ElementwiseLessThanImplementation(otherulongColumn); + } + } + public partial class UInt16DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(ByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseEqualsImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseNotEqualsImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseLessThanOrEqualImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseGreaterThanImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(ByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseLessThanImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DecimalDataFrameColumn column) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(DoubleDataFrameColumn column) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(SingleDataFrameColumn column) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int32DataFrameColumn column) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int64DataFrameColumn column) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(SByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseEqualsImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(SByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseNotEqualsImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(SByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(SByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseLessThanOrEqualImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(SByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseGreaterThanImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(SByteDataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseLessThanImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(Int16DataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseEqualsImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseNotEquals(Int16DataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseNotEqualsImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(Int16DataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseGreaterThanOrEqualImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(Int16DataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseLessThanOrEqualImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(Int16DataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseGreaterThanImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseLessThan(Int16DataFrameColumn column) + { + UInt16DataFrameColumn otherushortColumn = column.CloneAsUInt16Column(); + return ElementwiseLessThanImplementation(otherushortColumn); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt32DataFrameColumn column) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt64DataFrameColumn column) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseEquals(UInt16DataFrameColumn column) + { + return ElementwiseEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseNotEquals(UInt16DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(UInt16DataFrameColumn column) + { + return ElementwiseGreaterThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(UInt16DataFrameColumn column) + { + return ElementwiseLessThanOrEqualImplementation(column); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(UInt16DataFrameColumn column) + { + return ElementwiseGreaterThanImplementation(column); + } + public BooleanDataFrameColumn ElementwiseLessThan(UInt16DataFrameColumn column) + { + return ElementwiseLessThanImplementation(column); + } + } + public partial class BooleanDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(bool value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(bool value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(bool value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(bool value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(bool value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(bool value) + { + return ElementwiseLessThanImplementation(value); + } + } + public partial class ByteDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + byte otherbyteValue = (byte)value; + return ElementwiseEqualsImplementation(otherbyteValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + byte otherbyteValue = (byte)value; + return ElementwiseNotEqualsImplementation(otherbyteValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + byte otherbyteValue = (byte)value; + return ElementwiseGreaterThanOrEqualImplementation(otherbyteValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + byte otherbyteValue = (byte)value; + return ElementwiseLessThanOrEqualImplementation(otherbyteValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + byte otherbyteValue = (byte)value; + return ElementwiseGreaterThanImplementation(otherbyteValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + byte otherbyteValue = (byte)value; + return ElementwiseLessThanImplementation(otherbyteValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanImplementation(value); + } + } + public partial class DecimalDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseNotEqualsImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanOrEqualImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseGreaterThanImplementation(otherdecimalValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + decimal otherdecimalValue = (decimal)value; + return ElementwiseLessThanImplementation(otherdecimalValue); + } + } + public partial class DoubleDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + double otherdoubleValue = (double)value; + return ElementwiseEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + double otherdoubleValue = (double)value; + return ElementwiseNotEqualsImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanOrEqualImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + double otherdoubleValue = (double)value; + return ElementwiseGreaterThanImplementation(otherdoubleValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + double otherdoubleValue = (double)value; + return ElementwiseLessThanImplementation(otherdoubleValue); + } + } + public partial class SingleDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + float otherfloatValue = (float)value; + return ElementwiseEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + float otherfloatValue = (float)value; + return ElementwiseNotEqualsImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanOrEqualImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + float otherfloatValue = (float)value; + return ElementwiseGreaterThanImplementation(otherfloatValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + float otherfloatValue = (float)value; + return ElementwiseLessThanImplementation(otherfloatValue); + } + } + public partial class Int32DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + int otherintValue = (int)value; + return ElementwiseEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + int otherintValue = (int)value; + return ElementwiseNotEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + int otherintValue = (int)value; + return ElementwiseLessThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + int otherintValue = (int)value; + return ElementwiseLessThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + int otherintValue = (int)value; + return ElementwiseEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + int otherintValue = (int)value; + return ElementwiseNotEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + int otherintValue = (int)value; + return ElementwiseLessThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + int otherintValue = (int)value; + return ElementwiseLessThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + int otherintValue = (int)value; + return ElementwiseEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + int otherintValue = (int)value; + return ElementwiseNotEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + int otherintValue = (int)value; + return ElementwiseLessThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + int otherintValue = (int)value; + return ElementwiseLessThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + int otherintValue = (int)value; + return ElementwiseEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + int otherintValue = (int)value; + return ElementwiseNotEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + int otherintValue = (int)value; + return ElementwiseLessThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + int otherintValue = (int)value; + return ElementwiseLessThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + int otherintValue = (int)value; + return ElementwiseEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + int otherintValue = (int)value; + return ElementwiseNotEqualsImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + int otherintValue = (int)value; + return ElementwiseLessThanOrEqualImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + int otherintValue = (int)value; + return ElementwiseGreaterThanImplementation(otherintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + int otherintValue = (int)value; + return ElementwiseLessThanImplementation(otherintValue); + } + } + public partial class Int64DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + long otherlongValue = (long)value; + return ElementwiseEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + long otherlongValue = (long)value; + return ElementwiseNotEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + long otherlongValue = (long)value; + return ElementwiseEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + long otherlongValue = (long)value; + return ElementwiseNotEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + long otherlongValue = (long)value; + return ElementwiseEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + long otherlongValue = (long)value; + return ElementwiseNotEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + long otherlongValue = (long)value; + return ElementwiseEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + long otherlongValue = (long)value; + return ElementwiseNotEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + long otherlongValue = (long)value; + return ElementwiseEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + long otherlongValue = (long)value; + return ElementwiseNotEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + long otherlongValue = (long)value; + return ElementwiseEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + long otherlongValue = (long)value; + return ElementwiseNotEqualsImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanOrEqualImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + long otherlongValue = (long)value; + return ElementwiseGreaterThanImplementation(otherlongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + long otherlongValue = (long)value; + return ElementwiseLessThanImplementation(otherlongValue); + } + } + public partial class SByteDataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + sbyte othersbyteValue = (sbyte)value; + return ElementwiseEqualsImplementation(othersbyteValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + sbyte othersbyteValue = (sbyte)value; + return ElementwiseNotEqualsImplementation(othersbyteValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + sbyte othersbyteValue = (sbyte)value; + return ElementwiseGreaterThanOrEqualImplementation(othersbyteValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + sbyte othersbyteValue = (sbyte)value; + return ElementwiseLessThanOrEqualImplementation(othersbyteValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + sbyte othersbyteValue = (sbyte)value; + return ElementwiseGreaterThanImplementation(othersbyteValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + sbyte othersbyteValue = (sbyte)value; + return ElementwiseLessThanImplementation(othersbyteValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + Int16DataFrameColumn shortColumn = CloneAsInt16Column(); + return shortColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + UInt16DataFrameColumn ushortColumn = CloneAsUInt16Column(); + return ushortColumn.ElementwiseLessThanImplementation(value); + } + } + public partial class Int16DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + short othershortValue = (short)value; + return ElementwiseEqualsImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + short othershortValue = (short)value; + return ElementwiseNotEqualsImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + short othershortValue = (short)value; + return ElementwiseGreaterThanOrEqualImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + short othershortValue = (short)value; + return ElementwiseLessThanOrEqualImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + short othershortValue = (short)value; + return ElementwiseGreaterThanImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + short othershortValue = (short)value; + return ElementwiseLessThanImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + short othershortValue = (short)value; + return ElementwiseEqualsImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + short othershortValue = (short)value; + return ElementwiseNotEqualsImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + short othershortValue = (short)value; + return ElementwiseGreaterThanOrEqualImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + short othershortValue = (short)value; + return ElementwiseLessThanOrEqualImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + short othershortValue = (short)value; + return ElementwiseGreaterThanImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + short othershortValue = (short)value; + return ElementwiseLessThanImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + short othershortValue = (short)value; + return ElementwiseEqualsImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + short othershortValue = (short)value; + return ElementwiseNotEqualsImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + short othershortValue = (short)value; + return ElementwiseGreaterThanOrEqualImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + short othershortValue = (short)value; + return ElementwiseLessThanOrEqualImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + short othershortValue = (short)value; + return ElementwiseGreaterThanImplementation(othershortValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + short othershortValue = (short)value; + return ElementwiseLessThanImplementation(othershortValue); + } + } + public partial class UInt32DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + uint otheruintValue = (uint)value; + return ElementwiseEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + uint otheruintValue = (uint)value; + return ElementwiseNotEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + uint otheruintValue = (uint)value; + return ElementwiseEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + uint otheruintValue = (uint)value; + return ElementwiseNotEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + uint otheruintValue = (uint)value; + return ElementwiseEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + uint otheruintValue = (uint)value; + return ElementwiseNotEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + uint otheruintValue = (uint)value; + return ElementwiseEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + uint otheruintValue = (uint)value; + return ElementwiseNotEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + uint otheruintValue = (uint)value; + return ElementwiseEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + uint otheruintValue = (uint)value; + return ElementwiseNotEqualsImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanOrEqualImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + uint otheruintValue = (uint)value; + return ElementwiseGreaterThanImplementation(otheruintValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + uint otheruintValue = (uint)value; + return ElementwiseLessThanImplementation(otheruintValue); + } + } + public partial class UInt64DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseNotEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseNotEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseNotEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseNotEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseNotEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + return ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseNotEqualsImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanOrEqualImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseGreaterThanImplementation(otherulongValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + ulong otherulongValue = (ulong)value; + return ElementwiseLessThanImplementation(otherulongValue); + } + } + public partial class UInt16DataFrameColumn + { + public BooleanDataFrameColumn ElementwiseEquals(byte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseEqualsImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(byte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseNotEqualsImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(byte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseGreaterThanOrEqualImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(byte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseLessThanOrEqualImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(byte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseGreaterThanImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(byte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseLessThanImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(decimal value) + { + DecimalDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + return decimalColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(double value) + { + DoubleDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + return doubleColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(float value) + { + SingleDataFrameColumn floatColumn = CloneAsSingleColumn(); + return floatColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(int value) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + return intColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(long value) + { + Int64DataFrameColumn longColumn = CloneAsInt64Column(); + return longColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(sbyte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseEqualsImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(sbyte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseNotEqualsImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(sbyte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseGreaterThanOrEqualImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(sbyte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseLessThanOrEqualImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(sbyte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseGreaterThanImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(sbyte value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseLessThanImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseEquals(short value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseEqualsImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseNotEquals(short value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseNotEqualsImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(short value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseGreaterThanOrEqualImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(short value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseLessThanOrEqualImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(short value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseGreaterThanImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseLessThan(short value) + { + ushort otherushortValue = (ushort)value; + return ElementwiseLessThanImplementation(otherushortValue); + } + public BooleanDataFrameColumn ElementwiseEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(uint value) + { + UInt32DataFrameColumn uintColumn = CloneAsUInt32Column(); + return uintColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ulong value) + { + UInt64DataFrameColumn ulongColumn = CloneAsUInt64Column(); + return ulongColumn.ElementwiseLessThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseEquals(ushort value) + { + return ElementwiseEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseNotEquals(ushort value) + { + return ElementwiseNotEqualsImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThanOrEqual(ushort value) + { + return ElementwiseGreaterThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThanOrEqual(ushort value) + { + return ElementwiseLessThanOrEqualImplementation(value); + } + public BooleanDataFrameColumn ElementwiseGreaterThan(ushort value) + { + return ElementwiseGreaterThanImplementation(value); + } + public BooleanDataFrameColumn ElementwiseLessThan(ushort value) + { + return ElementwiseLessThanImplementation(value); + } + } + + public partial class ByteDataFrameColumn + { + public new Int32DataFrameColumn LeftShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.LeftShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class Int32DataFrameColumn + { + public new Int32DataFrameColumn LeftShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.LeftShift(value, inPlace); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class Int64DataFrameColumn + { + public new Int64DataFrameColumn LeftShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.LeftShift(value, inPlace); + return new Int64DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class SByteDataFrameColumn + { + public new Int32DataFrameColumn LeftShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.LeftShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class Int16DataFrameColumn + { + public new Int32DataFrameColumn LeftShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.LeftShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class UInt32DataFrameColumn + { + public new UInt32DataFrameColumn LeftShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.LeftShift(value, inPlace); + return new UInt32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class UInt64DataFrameColumn + { + public new UInt64DataFrameColumn LeftShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.LeftShift(value, inPlace); + return new UInt64DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class UInt16DataFrameColumn + { + public new Int32DataFrameColumn LeftShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.LeftShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class ByteDataFrameColumn + { + public new Int32DataFrameColumn RightShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.RightShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class Int32DataFrameColumn + { + public new Int32DataFrameColumn RightShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.RightShift(value, inPlace); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class Int64DataFrameColumn + { + public new Int64DataFrameColumn RightShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.RightShift(value, inPlace); + return new Int64DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class SByteDataFrameColumn + { + public new Int32DataFrameColumn RightShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.RightShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class Int16DataFrameColumn + { + public new Int32DataFrameColumn RightShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.RightShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class UInt32DataFrameColumn + { + public new UInt32DataFrameColumn RightShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.RightShift(value, inPlace); + return new UInt32DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class UInt64DataFrameColumn + { + public new UInt64DataFrameColumn RightShift(int value, bool inPlace = false) + { + var result = (PrimitiveDataFrameColumn)base.RightShift(value, inPlace); + return new UInt64DataFrameColumn(result.Name, result.ColumnContainer); + } + } + public partial class UInt16DataFrameColumn + { + public new Int32DataFrameColumn RightShift(int value, bool inPlace = false) + { + Int32DataFrameColumn intColumn = CloneAsInt32Column(); + var result = (PrimitiveDataFrameColumn)(intColumn.RightShift(value, inPlace)); + return new Int32DataFrameColumn(result.Name, result.ColumnContainer); + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt new file mode 100644 index 0000000000..e0e9067917 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt @@ -0,0 +1,606 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude"#> +<#@ include file="PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperationAPIs.ExplodedColumns.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ +<# +bool supportedInPlace(string type1, string type2) +{ + string ret = GetBinaryOperationReturnType(type1, type2); + if (ret == type1) + { + return true; + } + return false; +} +#> +<# +void GenerateAllBinaryCombinationsForMethod() +{ + HashSet visited = new HashSet { }; + foreach (TypeCombination outer in BinaryOperationCombinations.binaryOperationCombinations) + { + string outerColumnType = outer.ThisColumnType; + if (visited.Contains(outerColumnType)) + { + continue; + } + visited.Add(outerColumnType); + string fullOuterColumnType = GetCapitalizedPrimitiveTypes(outerColumnType) + "DataFrameColumn"; +#> + public partial class <#=fullOuterColumnType#> + { +<# + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations.Where((ACombination) => ACombination.ThisColumnType == outerColumnType)) + { + foreach (MethodConfiguration method in methodConfiguration) + { + if (method.MethodType == MethodType.Binary && method.IsNumeric) + { + string methodName = method.MethodName; + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); +#> +<# + if (supportedInPlace(columnType, otherColumnType)) + { +#> + public <#=fullReturnType#> <#=methodName#>(<#=fullOtherColumnType#> column, bool inPlace = false) +<# + } + else + { +#> + public <#=fullReturnType#> <#=methodName#>(<#=fullOtherColumnType#> column) +<# + } +#> + { +<# + if (columnType == otherColumnType) + { + // Handle the straightforward cases such as int + int resulting in int + if (fullReturnType == fullColumnType || fullReturnType == fullOtherColumnType) + { +#> + return <#=methodName#>Implementation(column, inPlace); +<# + } + else + { + // Cases such as byte + byte resulting in int. Needs 2 clones +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + <#=fullReturnType#> other<#=returnType#>Column = column.CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(other<#=returnType#>Column, inPlace: true); +<# + } + } + else + { + // Handle the straightforward cases + if (fullReturnType == fullColumnType || fullReturnType == fullOtherColumnType) + { + primitiveTypeToPrimitivityLevelMap.TryGetValue(columnType, out int columnTypeLevel); + primitiveTypeToPrimitivityLevelMap.TryGetValue(otherColumnType, out int otherColumnTypeLevel); + if (otherColumnTypeLevel > columnTypeLevel) + { +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(column, inPlace: true); +<# + } + else + { +#> + <#=fullReturnType#> other<#=returnType#>Column = column.CloneAs<#=capitalizedReturnType#>Column(); + return <#=methodName#>Implementation(other<#=returnType#>Column, inPlace); +<# + } + } + else + { + // Cases such as byte + short resulting in int. Needs 2 clones +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + <#=fullReturnType#> other<#=returnType#>Column = column.CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(other<#=returnType#>Column, inPlace: true); +<# + } + } +#> + } +<# + } + } + } +#> + } +<# +} +} +#> +<# +void GenerateAllBinaryScalarCombinationsForMethod() +{ + HashSet visited = new HashSet { }; + foreach (TypeCombination outer in BinaryOperationCombinations.binaryOperationCombinations) + { + string outerColumnType = outer.ThisColumnType; + if (visited.Contains(outerColumnType)) + { + continue; + } + visited.Add(outerColumnType); + string fullOuterColumnType = GetCapitalizedPrimitiveTypes(outerColumnType) + "DataFrameColumn"; +#> + public partial class <#=fullOuterColumnType#> + { +<# + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations.Where((ACombination) => ACombination.ThisColumnType == outerColumnType)) + { + foreach (MethodConfiguration method in methodConfiguration) + { + if (method.MethodType == MethodType.BinaryScalar && method.IsNumeric) + { + string methodName = method.MethodName; + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string valueType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + +#> +<# + if (supportedInPlace(columnType, valueType)) + { +#> + public <#=fullReturnType#> <#=methodName#>(<#=valueType#> value, bool inPlace = false) +<# + } + else + { +#> + public <#=fullReturnType#> <#=methodName#>(<#=valueType#> value) +<# + } +#> + { +<# + if (columnType == valueType) + { + // Handle the straightforward cases such as int + int resulting in int + if (fullReturnType == fullColumnType) + { +#> + return <#=methodName#>Implementation(value, inPlace); +<# + } + else + { + // Cases such as byte + byte resulting in int. Needs 2 clones +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(value, inPlace: true); +<# + } + } + else + { + // Handle the straightforward cases + if (fullReturnType == fullColumnType) + { + primitiveTypeToPrimitivityLevelMap.TryGetValue(columnType, out int columnTypeLevel); + primitiveTypeToPrimitivityLevelMap.TryGetValue(valueType, out int valueTypeLevel); + if (valueTypeLevel > columnTypeLevel) + { +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(value, inPlace: true); +<# + } + else + { +#> + <#=returnType#> convertedValue = (<#=returnType#>)value; + return <#=methodName#>Implementation(convertedValue, inPlace); +<# + } + } + else + { + // Cases such as byte + short resulting in int. Needs 2 clones +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(value, inPlace: true); +<# + } + } +#> + } +<# + } + if (method.MethodType == MethodType.BinaryScalar && method.IsNumeric) + { + string methodName = "Reverse" + method.MethodName; + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string valueType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + +#> +<# + if (supportedInPlace(columnType, valueType)) + { +#> + public <#=fullReturnType#> <#=methodName#>(<#=valueType#> value, bool inPlace = false) +<# + } + else + { +#> + public <#=fullReturnType#> <#=methodName#>(<#=valueType#> value) +<# + } +#> + { +<# + if (columnType == valueType) + { + // Handle the straightforward cases such as int + int resulting in int + if (fullReturnType == fullColumnType) + { +#> + return <#=methodName#>Implementation(value, inPlace); +<# + } + else + { + // Cases such as byte + byte resulting in int. Needs 2 clones +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(value, inPlace: true); +<# + } + } + else + { + // Handle the straightforward cases + if (fullReturnType == fullColumnType) + { + primitiveTypeToPrimitivityLevelMap.TryGetValue(columnType, out int columnTypeLevel); + primitiveTypeToPrimitivityLevelMap.TryGetValue(valueType, out int valueTypeLevel); + if (valueTypeLevel > columnTypeLevel) + { +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(value, inPlace: true); +<# + } + else + { +#> + <#=returnType#> convertedValue = (<#=returnType#>)value; + return <#=methodName#>Implementation(convertedValue, inPlace); +<# + } + } + else + { + // Cases such as byte + short resulting in int. Needs 2 clones +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + return <#=returnType#>Column.<#=methodName#>Implementation(value, inPlace: true); +<# + } + } +#> + } +<# + } + } + } +#> + } +<# +} +} +#> +<# +void GenerateAllBinaryBitwiseOperationsForMethod(string methodName) +{ +#> + public partial class BooleanDataFrameColumn + { + public BooleanDataFrameColumn <#=methodName#>(BooleanDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.<#=methodName#>(column.ColumnContainer); + return retColumn; + } + } +<# +} +#> +<# +void GenerateAllBinaryScalarBitwiseOperationsForMethod(string methodName) +{ +#> + public partial class BooleanDataFrameColumn + { + public new BooleanDataFrameColumn <#=methodName#>(bool value, bool inPlace = false) + { + BooleanDataFrameColumn retColumn = inPlace ? this : CloneAsBooleanColumn(); + retColumn.ColumnContainer.<#=methodName#>(value); + return retColumn; + } + } +<# +} +#> +<# + GenerateAllBinaryCombinationsForMethod(); + GenerateAllBinaryScalarCombinationsForMethod(); +foreach (MethodConfiguration method in methodConfiguration) +{ + if (method.MethodType == MethodType.Binary && method.IsBitwise) + { + GenerateAllBinaryBitwiseOperationsForMethod(method.MethodName); + } + else if (method.MethodType == MethodType.BinaryScalar && method.IsBitwise) + { + GenerateAllBinaryScalarBitwiseOperationsForMethod(method.MethodName); + } +} +#> +<# +void GenerateAllComparisonCombinationsForMethod() +{ + HashSet visited = new HashSet { }; + foreach (TypeCombination outer in ComparisonOperationCombinations.comparisonOperationCombinations) + { + string outerColumnType = outer.ThisColumnType; + if (visited.Contains(outerColumnType)) + { + continue; + } + visited.Add(outerColumnType); + string fullOuterColumnType = GetCapitalizedPrimitiveTypes(outerColumnType) + "DataFrameColumn"; +#> + public partial class <#=fullOuterColumnType#> + { +<# + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations.Where((ACombination) => ACombination.ThisColumnType == outerColumnType)) + { +foreach (MethodConfiguration method in methodConfiguration) +{ + if (method.MethodType == MethodType.ComparisonScalar) + { + string methodName = method.MethodName; + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); + +#> + public <#=fullReturnType#> <#=methodName#>(<#=fullOtherColumnType#> column) + { +<# + if (columnType == otherColumnType) + { +#> + return <#=methodName#>Implementation(column); +<# + } + else + { + primitiveTypeToPrimitivityLevelMap.TryGetValue(columnType, out int columnTypeLevel); + primitiveTypeToPrimitivityLevelMap.TryGetValue(otherColumnType, out int otherColumnTypeLevel); + if (otherColumnTypeLevel > columnTypeLevel) + { +#> + <#=fullOtherColumnType#> <#=otherColumnType#>Column = CloneAs<#=capitalizedOtherColumnType#>Column(); + return <#=otherColumnType#>Column.<#=methodName#>Implementation(column); +<# + } + else + { +#> + <#=fullColumnType#> other<#=columnType#>Column = column.CloneAs<#=capitalizedColumnType#>Column(); + return <#=methodName#>Implementation(other<#=columnType#>Column); +<# + } +#> +<# + } +#> + } +<# + } + } + } +#> + } +<# + } + } +#> + +<# +void GenerateAllComparisonScalarCombinationsForMethod() +{ + HashSet visited = new HashSet { }; + foreach (TypeCombination outer in ComparisonOperationCombinations.comparisonOperationCombinations) + { + string outerColumnType = outer.ThisColumnType; + if (visited.Contains(outerColumnType)) + { + continue; + } + visited.Add(outerColumnType); + string fullOuterColumnType = GetCapitalizedPrimitiveTypes(outerColumnType) + "DataFrameColumn"; +#> + public partial class <#=fullOuterColumnType#> + { +<# + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations.Where((ACombination) => ACombination.ThisColumnType == outerColumnType)) +{ +foreach (MethodConfiguration method in methodConfiguration) +{ + if (method.MethodType == MethodType.Comparison) + { + string methodName = method.MethodName; + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); +#> + public <#=fullReturnType#> <#=methodName#>(<#=otherColumnType#> value) + { +<# + if (columnType == otherColumnType) + { +#> + return <#=methodName#>Implementation(value); +<# + } + else + { + primitiveTypeToPrimitivityLevelMap.TryGetValue(columnType, out int columnTypeLevel); + primitiveTypeToPrimitivityLevelMap.TryGetValue(otherColumnType, out int otherColumnTypeLevel); + if (otherColumnTypeLevel > columnTypeLevel) + { +#> + <#=fullOtherColumnType#> <#=otherColumnType#>Column = CloneAs<#=capitalizedOtherColumnType#>Column(); + return <#=otherColumnType#>Column.<#=methodName#>Implementation(value); +<# + } + else + { +#> + <#=columnType#> other<#=columnType#>Value = (<#=columnType#>)value; + return <#=methodName#>Implementation(other<#=columnType#>Value); +<# + } +#> +<# + } +#> + } +<# + } + } + } +#> + } +<# +} +} +#> +<# + GenerateAllComparisonCombinationsForMethod(); + GenerateAllComparisonScalarCombinationsForMethod(); +#> + +<# +void GenerateAllBinaryShiftCombinationsForMethod(string methodName) +{ + foreach (var type in typeConfiguration) + { + if (!type.SupportsNumeric || !type.SupportsBitwise || type.TypeName == "char") + { + continue; + } + + string returnType = GetBinaryShiftOperationReturnType(type); + if (returnType == string.Empty) + { + continue; + } + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullColumnType = GetCapitalizedPrimitiveTypes(type.TypeName) + "DataFrameColumn"; + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); +#> + public partial class <#=fullColumnType#> + { + public new <#=fullReturnType#> <#=methodName#>(int value, bool inPlace = false) + { +<# + if (fullColumnType == fullReturnType) + { +#> + var result = (PrimitiveDataFrameColumn<<#=returnType#>>)base.<#=methodName#>(value, inPlace); + return new <#=fullReturnType#>(result.Name, result.ColumnContainer); +<# + } + else + { +#> + <#=fullReturnType#> <#=returnType#>Column = CloneAs<#=capitalizedReturnType#>Column(); + var result = (PrimitiveDataFrameColumn<<#=returnType#>>)(<#=returnType#>Column.<#=methodName#>(value, inPlace)); + return new <#=fullReturnType#>(result.Name, result.ColumnContainer); +<# + } +#> + } + } +<# + } +} +#> +<# +foreach (MethodConfiguration method in methodConfiguration) +{ + if (method.MethodType == MethodType.BinaryInt) + { + GenerateAllBinaryShiftCombinationsForMethod(method.MethodName); + } +} +#> +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.cs new file mode 100644 index 0000000000..9dd963a338 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.cs @@ -0,0 +1,2395 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperationImplementations.ExplodedColumns.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn AddImplementation(DecimalDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn AddImplementation(DoubleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn AddImplementation(SingleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn AddImplementation(Int32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn AddImplementation(Int64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn AddImplementation(UInt32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn AddImplementation(UInt64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Add(column.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn AddImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn AddImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn AddImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn AddImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn AddImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn AddImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn AddImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Add(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ReverseAddImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ReverseAddImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ReverseAddImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ReverseAddImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ReverseAddImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ReverseAddImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ReverseAddImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.ReverseAdd(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn SubtractImplementation(DecimalDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn SubtractImplementation(DoubleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn SubtractImplementation(SingleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn SubtractImplementation(Int32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn SubtractImplementation(Int64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn SubtractImplementation(UInt32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn SubtractImplementation(UInt64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Subtract(column.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn SubtractImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn SubtractImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn SubtractImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn SubtractImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn SubtractImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn SubtractImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn SubtractImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Subtract(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ReverseSubtractImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ReverseSubtractImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ReverseSubtractImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ReverseSubtractImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ReverseSubtractImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ReverseSubtractImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ReverseSubtractImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.ReverseSubtract(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn MultiplyImplementation(DecimalDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn MultiplyImplementation(DoubleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn MultiplyImplementation(SingleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn MultiplyImplementation(Int32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn MultiplyImplementation(Int64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn MultiplyImplementation(UInt32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn MultiplyImplementation(UInt64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Multiply(column.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn MultiplyImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn MultiplyImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn MultiplyImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn MultiplyImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn MultiplyImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn MultiplyImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn MultiplyImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Multiply(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ReverseMultiplyImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ReverseMultiplyImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ReverseMultiplyImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ReverseMultiplyImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ReverseMultiplyImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ReverseMultiplyImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ReverseMultiplyImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.ReverseMultiply(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn DivideImplementation(DecimalDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn DivideImplementation(DoubleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn DivideImplementation(SingleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn DivideImplementation(Int32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn DivideImplementation(Int64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn DivideImplementation(UInt32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn DivideImplementation(UInt64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Divide(column.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn DivideImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn DivideImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn DivideImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn DivideImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn DivideImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn DivideImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn DivideImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Divide(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ReverseDivideImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ReverseDivideImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ReverseDivideImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ReverseDivideImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ReverseDivideImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ReverseDivideImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ReverseDivideImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.ReverseDivide(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ModuloImplementation(DecimalDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ModuloImplementation(DoubleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ModuloImplementation(SingleDataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ModuloImplementation(Int32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ModuloImplementation(Int64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ModuloImplementation(UInt32DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ModuloImplementation(UInt64DataFrameColumn column, bool inPlace = false) + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Modulo(column.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ModuloImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ModuloImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ModuloImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ModuloImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ModuloImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ModuloImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ModuloImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.Modulo(value); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal DecimalDataFrameColumn ReverseModuloImplementation(decimal value, bool inPlace = false) + { + DecimalDataFrameColumn newColumn = inPlace ? this : CloneAsDecimalColumn(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal DoubleDataFrameColumn ReverseModuloImplementation(double value, bool inPlace = false) + { + DoubleDataFrameColumn newColumn = inPlace ? this : CloneAsDoubleColumn(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal SingleDataFrameColumn ReverseModuloImplementation(float value, bool inPlace = false) + { + SingleDataFrameColumn newColumn = inPlace ? this : CloneAsSingleColumn(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal Int32DataFrameColumn ReverseModuloImplementation(int value, bool inPlace = false) + { + Int32DataFrameColumn newColumn = inPlace ? this : CloneAsInt32Column(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal Int64DataFrameColumn ReverseModuloImplementation(long value, bool inPlace = false) + { + Int64DataFrameColumn newColumn = inPlace ? this : CloneAsInt64Column(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal UInt32DataFrameColumn ReverseModuloImplementation(uint value, bool inPlace = false) + { + UInt32DataFrameColumn newColumn = inPlace ? this : CloneAsUInt32Column(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal UInt64DataFrameColumn ReverseModuloImplementation(ulong value, bool inPlace = false) + { + UInt64DataFrameColumn newColumn = inPlace ? this : CloneAsUInt64Column(); + newColumn.ColumnContainer.ReverseModulo(value); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(BooleanDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(ByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(DecimalDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(DoubleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(SingleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(Int32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(Int64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(SByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(Int16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(UInt32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(UInt64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(UInt16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(bool value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(byte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(decimal value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(double value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(float value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(int value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(long value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(sbyte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(short value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(uint value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(ulong value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseEqualsImplementation(ushort value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(BooleanDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(ByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(DecimalDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(DoubleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(SingleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(Int32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(Int64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(SByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(Int16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(UInt32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(UInt64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(UInt16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(bool value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(byte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(decimal value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(double value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(float value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(int value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(long value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(sbyte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(short value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(uint value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(ulong value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseNotEqualsImplementation(ushort value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseNotEquals(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(BooleanDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(ByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(DecimalDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(DoubleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(SingleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(Int32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(Int64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(SByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(Int16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(UInt32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(UInt64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(UInt16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(bool value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(byte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(decimal value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(double value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(float value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(int value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(long value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(sbyte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(short value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(uint value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(ulong value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(ushort value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(BooleanDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(ByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(DecimalDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(DoubleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(SingleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(Int32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(Int64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(SByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(Int16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(UInt32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(UInt64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(UInt16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(bool value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(byte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(decimal value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(double value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(float value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(int value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(long value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(sbyte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(short value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(uint value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(ulong value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanOrEqualImplementation(ushort value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThanOrEqual(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(BooleanDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(ByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(DecimalDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(DoubleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(SingleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(Int32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(Int64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(SByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(Int16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(UInt32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(UInt64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(UInt16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(bool value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(byte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(decimal value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(double value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(float value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(int value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(long value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(sbyte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(short value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(uint value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(ulong value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseGreaterThanImplementation(ushort value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseGreaterThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(BooleanDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(ByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(DecimalDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(DoubleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(SingleDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(Int32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(Int64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(SByteDataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(Int16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(UInt32DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(UInt64DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(UInt16DataFrameColumn column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class BooleanDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(bool value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class ByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(byte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DecimalDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(decimal value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class DoubleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(double value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SingleDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(float value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(int value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(long value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class SByteDataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(sbyte value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class Int16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(short value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt32DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(uint value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt64DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(ulong value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } + public partial class UInt16DataFrameColumn + { + internal BooleanDataFrameColumn ElementwiseLessThanImplementation(ushort value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.ElementwiseLessThan(value, newColumn.ColumnContainer); + return newColumn; + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.tt new file mode 100644 index 0000000000..d71534742a --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperationImplementations.Exploded.tt @@ -0,0 +1,235 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ import namespace="System.Diagnostics" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude"#> +<#@ include file="PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperationImplementations.ExplodedColumns.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ +<# +bool supportedInPlace(string type1, string type2) +{ + string ret = GetBinaryOperationReturnType(type1, type2); + if (ret == type1) + { + return true; + } + return false; +} +#> +<# +// This method generates implementations where the arguments are of the same type. +void GenerateAllBinaryCombinationsForMethod(string inputMethodName) +{ + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + if (columnType != otherColumnType) + { + continue; + } + if (columnType != returnType) + { + continue; + } + Debug.Assert(returnType == otherColumnType); + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = fullColumnType; + string fullOtherColumnType = fullColumnType; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string methodName = inputMethodName + "Implementation"; +#> + public partial class <#=fullColumnType#> + { +<# + if (supportedInPlace(columnType, otherColumnType)) + { +#> + internal <#=fullReturnType#> <#=methodName#>(<#=fullOtherColumnType#> column, bool inPlace = false) +<# + } + else + { +#> + internal <#=fullReturnType#> <#=methodName#>(<#=fullOtherColumnType#> column) +<# + } +#> + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + <#=fullReturnType#> newColumn = inPlace ? this : CloneAs<#=capitalizedReturnType#>Column(); + newColumn.ColumnContainer.<#=inputMethodName#>(column.ColumnContainer); + return newColumn; + } + } +<# +} +} +#> +<# +// This method generates implementations where the arguments are of the same type. +void GenerateAllBinaryScalarCombinationsForMethod(string inputMethodName) +{ + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + if (columnType != otherColumnType) + { + continue; + } + if (columnType != returnType) + { + continue; + } + Debug.Assert(returnType == otherColumnType); + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = fullColumnType; + string fullOtherColumnType = fullColumnType; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string methodName = inputMethodName; + methodName += "Implementation"; +#> + public partial class <#=fullColumnType#> + { +<# + if (supportedInPlace(columnType, otherColumnType)) + { +#> + internal <#=fullReturnType#> <#=methodName#>(<#=otherColumnType#> value, bool inPlace = false) +<# + } + else + { +#> + internal <#=fullReturnType#> <#=methodName#>(<#=otherColumnType#> value) +<# + } +#> + { + <#=fullReturnType#> newColumn = inPlace ? this : CloneAs<#=capitalizedReturnType#>Column(); + newColumn.ColumnContainer.<#=inputMethodName#>(value); + return newColumn; + } + } +<# +} +} +#> +<# +void GenerateAllComparisonCombinationsForMethod(string inputMethodName) +{ + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations) + { + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + if (columnType != otherColumnType) + { + continue; + } + Debug.Assert(returnType == otherColumnType); + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string methodName = inputMethodName; + methodName += "Implementation"; + +#> + public partial class <#=fullColumnType#> + { + internal <#=fullReturnType#> <#=methodName#>(<#=fullOtherColumnType#> column) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.<#=inputMethodName#>(column.ColumnContainer, newColumn.ColumnContainer); + return newColumn; + } + } +<# + } + } +#> +<# +void GenerateAllComparisonScalarCombinationsForMethod(string inputMethodName) +{ + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations) + { + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + if (columnType != otherColumnType) + { + continue; + } + Debug.Assert(returnType == otherColumnType); + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string methodName = inputMethodName; + methodName += "Implementation"; + +#> + public partial class <#=fullColumnType#> + { + internal <#=fullReturnType#> <#=methodName#>(<#=otherColumnType#> value) + { + BooleanDataFrameColumn newColumn = CloneAsBooleanColumn(); + ColumnContainer.<#=inputMethodName#>(value, newColumn.ColumnContainer); + return newColumn; + } + } +<# + } + } +#> +<# +foreach (MethodConfiguration method in methodConfiguration) +{ + // Don't generate method for Comparison and ComparisonScalar methods here + if (method.MethodType == MethodType.Binary && method.IsNumeric) + { + GenerateAllBinaryCombinationsForMethod(method.MethodName); + } + else if (method.MethodType == MethodType.BinaryScalar && method.IsNumeric) + { + GenerateAllBinaryScalarCombinationsForMethod(method.MethodName); + GenerateAllBinaryScalarCombinationsForMethod("Reverse" + method.MethodName); + } + else if (method.MethodType == MethodType.Comparison) + { + GenerateAllComparisonCombinationsForMethod(method.MethodName); + } + else if (method.MethodType == MethodType.ComparisonScalar) + { + GenerateAllComparisonScalarCombinationsForMethod(method.MethodName); + } +} +#> +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt new file mode 100644 index 0000000000..33f0a0ad72 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt @@ -0,0 +1,116 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic"#> +<#@ output extension=".ttinclude"#> +<#@ include file="ColumnArithmeticTemplate.ttinclude"#> +\<#+ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt. Do not modify directly + +public class TypeCombination +{ + private string _thisColumnType; + private string _otherColumnType; + private string _returnColumnType; + + public TypeCombination(string thisColumnType, string otherColumnType, string returnColumnType) + { + _thisColumnType = thisColumnType; + _otherColumnType = otherColumnType; + _returnColumnType = returnColumnType; + } + public string ThisColumnType => _thisColumnType; + public string OtherColumnType => _otherColumnType; + public string ReturnColumnType => _returnColumnType; +} + +public static class BinaryOperationCombinations +{ + + public static List binaryOperationCombinations = new List + { +<# +foreach (TypeConfiguration type in typeConfiguration) +{ + if(!type.SupportsNumeric || type.TypeName == "char") + { + continue; + } + foreach (TypeConfiguration type2 in typeConfiguration) + { + if (!type2.SupportsNumeric || type2.TypeName == "char") + { + continue; + } +#> +<# +// We won't support binary operations on pairs of signed and unsigned types yet. For users, there is a simple work around of cloning the columns to higher types(short -> int, int -> long etc) and then performing binary ops on them +if (IsMixedSignedAndUnsignedTypePair(type.TypeName, type2.TypeName)) { + // continue; +} + +// If the C# spec doesn't allow some implicit conversions, don't define that API +string returnType = GetBinaryOperationReturnType(type, type2); +if (returnType == string.Empty) +{ + continue; +} +#> + new TypeCombination("<#=type.TypeName#>", "<#=type2.TypeName#>", "<#=returnType#>"), +<# + } +} +#> + }; +} + +public static class ComparisonOperationCombinations +{ + public static List comparisonOperationCombinations = new List + { +<# + foreach (TypeConfiguration type in typeConfiguration) + { + if (type.TypeName == "char") + { + continue; + } + foreach (TypeConfiguration innerType in typeConfiguration) + { + if (innerType.TypeName == "char") + { + continue; + } + if (type.TypeName == "bool" && innerType.TypeName != "bool") + { + continue; + } + if (type.SupportsNumeric != innerType.SupportsNumeric) + { + continue; + } + // For comparison, we don't exclude mixed signed and unsigned types since the result is always a bool + + if (type.SupportsNumeric) + { + // If the C# spec doesn't allow some implicit conversions, don't define that API. For ex: float == decimal or long == ulong are not allowed + string returnType = GetBinaryOperationReturnType(type, innerType); + if (returnType == string.Empty) + { + continue; + } + } +#> + new TypeCombination("<#=type.TypeName#>", "<#=innerType.TypeName#>", "bool"), +<# + } + } +#> + }; +} +\#> diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude new file mode 100644 index 0000000000..23a88d1f12 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude @@ -0,0 +1,271 @@ + +<#+ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.BinaryOperations.Combinations.tt. Do not modify directly + +public class TypeCombination +{ + private string _thisColumnType; + private string _otherColumnType; + private string _returnColumnType; + + public TypeCombination(string thisColumnType, string otherColumnType, string returnColumnType) + { + _thisColumnType = thisColumnType; + _otherColumnType = otherColumnType; + _returnColumnType = returnColumnType; + } + public string ThisColumnType => _thisColumnType; + public string OtherColumnType => _otherColumnType; + public string ReturnColumnType => _returnColumnType; +} + +public static class BinaryOperationCombinations +{ + + public static List binaryOperationCombinations = new List + { + new TypeCombination("byte", "byte", "int"), + new TypeCombination("byte", "decimal", "decimal"), + new TypeCombination("byte", "double", "double"), + new TypeCombination("byte", "float", "float"), + new TypeCombination("byte", "int", "int"), + new TypeCombination("byte", "long", "long"), + new TypeCombination("byte", "sbyte", "int"), + new TypeCombination("byte", "short", "int"), + new TypeCombination("byte", "uint", "uint"), + new TypeCombination("byte", "ulong", "ulong"), + new TypeCombination("byte", "ushort", "int"), + new TypeCombination("decimal", "byte", "decimal"), + new TypeCombination("decimal", "decimal", "decimal"), + new TypeCombination("decimal", "int", "decimal"), + new TypeCombination("decimal", "long", "decimal"), + new TypeCombination("decimal", "sbyte", "decimal"), + new TypeCombination("decimal", "short", "decimal"), + new TypeCombination("decimal", "uint", "decimal"), + new TypeCombination("decimal", "ulong", "decimal"), + new TypeCombination("decimal", "ushort", "decimal"), + new TypeCombination("double", "byte", "double"), + new TypeCombination("double", "double", "double"), + new TypeCombination("double", "float", "double"), + new TypeCombination("double", "int", "double"), + new TypeCombination("double", "long", "double"), + new TypeCombination("double", "sbyte", "double"), + new TypeCombination("double", "short", "double"), + new TypeCombination("double", "uint", "double"), + new TypeCombination("double", "ulong", "double"), + new TypeCombination("double", "ushort", "double"), + new TypeCombination("float", "byte", "float"), + new TypeCombination("float", "double", "double"), + new TypeCombination("float", "float", "float"), + new TypeCombination("float", "int", "float"), + new TypeCombination("float", "long", "float"), + new TypeCombination("float", "sbyte", "float"), + new TypeCombination("float", "short", "float"), + new TypeCombination("float", "uint", "float"), + new TypeCombination("float", "ulong", "float"), + new TypeCombination("float", "ushort", "float"), + new TypeCombination("int", "byte", "int"), + new TypeCombination("int", "decimal", "decimal"), + new TypeCombination("int", "double", "double"), + new TypeCombination("int", "float", "float"), + new TypeCombination("int", "int", "int"), + new TypeCombination("int", "long", "long"), + new TypeCombination("int", "sbyte", "int"), + new TypeCombination("int", "short", "int"), + new TypeCombination("int", "uint", "long"), + new TypeCombination("int", "ulong", "float"), + new TypeCombination("int", "ushort", "int"), + new TypeCombination("long", "byte", "long"), + new TypeCombination("long", "decimal", "decimal"), + new TypeCombination("long", "double", "double"), + new TypeCombination("long", "float", "float"), + new TypeCombination("long", "int", "long"), + new TypeCombination("long", "long", "long"), + new TypeCombination("long", "sbyte", "long"), + new TypeCombination("long", "short", "long"), + new TypeCombination("long", "uint", "long"), + new TypeCombination("long", "ushort", "long"), + new TypeCombination("sbyte", "byte", "int"), + new TypeCombination("sbyte", "decimal", "decimal"), + new TypeCombination("sbyte", "double", "double"), + new TypeCombination("sbyte", "float", "float"), + new TypeCombination("sbyte", "int", "int"), + new TypeCombination("sbyte", "long", "long"), + new TypeCombination("sbyte", "sbyte", "int"), + new TypeCombination("sbyte", "short", "int"), + new TypeCombination("sbyte", "uint", "long"), + new TypeCombination("sbyte", "ulong", "float"), + new TypeCombination("sbyte", "ushort", "int"), + new TypeCombination("short", "byte", "int"), + new TypeCombination("short", "decimal", "decimal"), + new TypeCombination("short", "double", "double"), + new TypeCombination("short", "float", "float"), + new TypeCombination("short", "int", "int"), + new TypeCombination("short", "long", "long"), + new TypeCombination("short", "sbyte", "int"), + new TypeCombination("short", "short", "int"), + new TypeCombination("short", "uint", "long"), + new TypeCombination("short", "ulong", "float"), + new TypeCombination("short", "ushort", "int"), + new TypeCombination("uint", "byte", "uint"), + new TypeCombination("uint", "decimal", "decimal"), + new TypeCombination("uint", "double", "double"), + new TypeCombination("uint", "float", "float"), + new TypeCombination("uint", "int", "long"), + new TypeCombination("uint", "long", "long"), + new TypeCombination("uint", "sbyte", "long"), + new TypeCombination("uint", "short", "long"), + new TypeCombination("uint", "uint", "uint"), + new TypeCombination("uint", "ulong", "ulong"), + new TypeCombination("uint", "ushort", "uint"), + new TypeCombination("ulong", "byte", "ulong"), + new TypeCombination("ulong", "decimal", "decimal"), + new TypeCombination("ulong", "double", "double"), + new TypeCombination("ulong", "float", "float"), + new TypeCombination("ulong", "int", "float"), + new TypeCombination("ulong", "sbyte", "float"), + new TypeCombination("ulong", "short", "float"), + new TypeCombination("ulong", "uint", "ulong"), + new TypeCombination("ulong", "ulong", "ulong"), + new TypeCombination("ulong", "ushort", "ulong"), + new TypeCombination("ushort", "byte", "int"), + new TypeCombination("ushort", "decimal", "decimal"), + new TypeCombination("ushort", "double", "double"), + new TypeCombination("ushort", "float", "float"), + new TypeCombination("ushort", "int", "int"), + new TypeCombination("ushort", "long", "long"), + new TypeCombination("ushort", "sbyte", "int"), + new TypeCombination("ushort", "short", "int"), + new TypeCombination("ushort", "uint", "uint"), + new TypeCombination("ushort", "ulong", "ulong"), + new TypeCombination("ushort", "ushort", "int"), + }; +} + +public static class ComparisonOperationCombinations +{ + public static List comparisonOperationCombinations = new List + { + new TypeCombination("bool", "bool", "bool"), + new TypeCombination("byte", "byte", "bool"), + new TypeCombination("byte", "decimal", "bool"), + new TypeCombination("byte", "double", "bool"), + new TypeCombination("byte", "float", "bool"), + new TypeCombination("byte", "int", "bool"), + new TypeCombination("byte", "long", "bool"), + new TypeCombination("byte", "sbyte", "bool"), + new TypeCombination("byte", "short", "bool"), + new TypeCombination("byte", "uint", "bool"), + new TypeCombination("byte", "ulong", "bool"), + new TypeCombination("byte", "ushort", "bool"), + new TypeCombination("decimal", "byte", "bool"), + new TypeCombination("decimal", "decimal", "bool"), + new TypeCombination("decimal", "int", "bool"), + new TypeCombination("decimal", "long", "bool"), + new TypeCombination("decimal", "sbyte", "bool"), + new TypeCombination("decimal", "short", "bool"), + new TypeCombination("decimal", "uint", "bool"), + new TypeCombination("decimal", "ulong", "bool"), + new TypeCombination("decimal", "ushort", "bool"), + new TypeCombination("double", "byte", "bool"), + new TypeCombination("double", "double", "bool"), + new TypeCombination("double", "float", "bool"), + new TypeCombination("double", "int", "bool"), + new TypeCombination("double", "long", "bool"), + new TypeCombination("double", "sbyte", "bool"), + new TypeCombination("double", "short", "bool"), + new TypeCombination("double", "uint", "bool"), + new TypeCombination("double", "ulong", "bool"), + new TypeCombination("double", "ushort", "bool"), + new TypeCombination("float", "byte", "bool"), + new TypeCombination("float", "double", "bool"), + new TypeCombination("float", "float", "bool"), + new TypeCombination("float", "int", "bool"), + new TypeCombination("float", "long", "bool"), + new TypeCombination("float", "sbyte", "bool"), + new TypeCombination("float", "short", "bool"), + new TypeCombination("float", "uint", "bool"), + new TypeCombination("float", "ulong", "bool"), + new TypeCombination("float", "ushort", "bool"), + new TypeCombination("int", "byte", "bool"), + new TypeCombination("int", "decimal", "bool"), + new TypeCombination("int", "double", "bool"), + new TypeCombination("int", "float", "bool"), + new TypeCombination("int", "int", "bool"), + new TypeCombination("int", "long", "bool"), + new TypeCombination("int", "sbyte", "bool"), + new TypeCombination("int", "short", "bool"), + new TypeCombination("int", "uint", "bool"), + new TypeCombination("int", "ulong", "bool"), + new TypeCombination("int", "ushort", "bool"), + new TypeCombination("long", "byte", "bool"), + new TypeCombination("long", "decimal", "bool"), + new TypeCombination("long", "double", "bool"), + new TypeCombination("long", "float", "bool"), + new TypeCombination("long", "int", "bool"), + new TypeCombination("long", "long", "bool"), + new TypeCombination("long", "sbyte", "bool"), + new TypeCombination("long", "short", "bool"), + new TypeCombination("long", "uint", "bool"), + new TypeCombination("long", "ushort", "bool"), + new TypeCombination("sbyte", "byte", "bool"), + new TypeCombination("sbyte", "decimal", "bool"), + new TypeCombination("sbyte", "double", "bool"), + new TypeCombination("sbyte", "float", "bool"), + new TypeCombination("sbyte", "int", "bool"), + new TypeCombination("sbyte", "long", "bool"), + new TypeCombination("sbyte", "sbyte", "bool"), + new TypeCombination("sbyte", "short", "bool"), + new TypeCombination("sbyte", "uint", "bool"), + new TypeCombination("sbyte", "ulong", "bool"), + new TypeCombination("sbyte", "ushort", "bool"), + new TypeCombination("short", "byte", "bool"), + new TypeCombination("short", "decimal", "bool"), + new TypeCombination("short", "double", "bool"), + new TypeCombination("short", "float", "bool"), + new TypeCombination("short", "int", "bool"), + new TypeCombination("short", "long", "bool"), + new TypeCombination("short", "sbyte", "bool"), + new TypeCombination("short", "short", "bool"), + new TypeCombination("short", "uint", "bool"), + new TypeCombination("short", "ulong", "bool"), + new TypeCombination("short", "ushort", "bool"), + new TypeCombination("uint", "byte", "bool"), + new TypeCombination("uint", "decimal", "bool"), + new TypeCombination("uint", "double", "bool"), + new TypeCombination("uint", "float", "bool"), + new TypeCombination("uint", "int", "bool"), + new TypeCombination("uint", "long", "bool"), + new TypeCombination("uint", "sbyte", "bool"), + new TypeCombination("uint", "short", "bool"), + new TypeCombination("uint", "uint", "bool"), + new TypeCombination("uint", "ulong", "bool"), + new TypeCombination("uint", "ushort", "bool"), + new TypeCombination("ulong", "byte", "bool"), + new TypeCombination("ulong", "decimal", "bool"), + new TypeCombination("ulong", "double", "bool"), + new TypeCombination("ulong", "float", "bool"), + new TypeCombination("ulong", "int", "bool"), + new TypeCombination("ulong", "sbyte", "bool"), + new TypeCombination("ulong", "short", "bool"), + new TypeCombination("ulong", "uint", "bool"), + new TypeCombination("ulong", "ulong", "bool"), + new TypeCombination("ulong", "ushort", "bool"), + new TypeCombination("ushort", "byte", "bool"), + new TypeCombination("ushort", "decimal", "bool"), + new TypeCombination("ushort", "double", "bool"), + new TypeCombination("ushort", "float", "bool"), + new TypeCombination("ushort", "int", "bool"), + new TypeCombination("ushort", "long", "bool"), + new TypeCombination("ushort", "sbyte", "bool"), + new TypeCombination("ushort", "short", "bool"), + new TypeCombination("ushort", "uint", "bool"), + new TypeCombination("ushort", "ulong", "bool"), + new TypeCombination("ushort", "ushort", "bool"), + }; +} +#> diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.cs new file mode 100644 index 0000000000..6ad8319edf --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.cs @@ -0,0 +1,2624 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.BinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { + /// + public override DataFrameColumn Add(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return AddImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn Add(U value, bool inPlace = false) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return Add(column, inPlace); + } + return AddImplementation(value, inPlace); + } + /// + public override DataFrameColumn Subtract(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return SubtractImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn Subtract(U value, bool inPlace = false) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return Subtract(column, inPlace); + } + return SubtractImplementation(value, inPlace); + } + /// + public override DataFrameColumn Multiply(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return MultiplyImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn Multiply(U value, bool inPlace = false) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return Multiply(column, inPlace); + } + return MultiplyImplementation(value, inPlace); + } + /// + public override DataFrameColumn Divide(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return DivideImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn Divide(U value, bool inPlace = false) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return Divide(column, inPlace); + } + return DivideImplementation(value, inPlace); + } + /// + public override DataFrameColumn Modulo(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return ModuloImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn Modulo(U value, bool inPlace = false) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return Modulo(column, inPlace); + } + return ModuloImplementation(value, inPlace); + } + /// + public override DataFrameColumn And(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return AndImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn And(bool value, bool inPlace = false) + { + return AndImplementation(value, inPlace); + } + /// + public override DataFrameColumn Or(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return OrImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn Or(bool value, bool inPlace = false) + { + return OrImplementation(value, inPlace); + } + /// + public override DataFrameColumn Xor(DataFrameColumn column, bool inPlace = false) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn byteColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn charColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn decimalColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn doubleColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn floatColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn intColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn longColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn sbyteColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn shortColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn uintColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ulongColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + case PrimitiveDataFrameColumn ushortColumn: + return XorImplementation(column as PrimitiveDataFrameColumn, inPlace); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn Xor(bool value, bool inPlace = false) + { + return XorImplementation(value, inPlace); + } + /// + public override DataFrameColumn LeftShift(int value, bool inPlace = false) + { + return LeftShiftImplementation(value, inPlace); + } + /// + public override DataFrameColumn RightShift(int value, bool inPlace = false) + { + return RightShiftImplementation(value, inPlace); + } + /// + public override PrimitiveDataFrameColumn ElementwiseEquals(DataFrameColumn column) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn byteColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn charColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn decimalColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn doubleColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn floatColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn intColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn longColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn sbyteColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn shortColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn uintColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ulongColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ushortColumn: + return ElementwiseEqualsImplementation(column as PrimitiveDataFrameColumn); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ElementwiseEquals(U value) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return ElementwiseEquals(column); + } + return ElementwiseEqualsImplementation(value); + } + /// + public override PrimitiveDataFrameColumn ElementwiseNotEquals(DataFrameColumn column) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn byteColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn charColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn decimalColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn doubleColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn floatColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn intColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn longColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn sbyteColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn shortColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn uintColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ulongColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ushortColumn: + return ElementwiseNotEqualsImplementation(column as PrimitiveDataFrameColumn); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ElementwiseNotEquals(U value) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return ElementwiseNotEquals(column); + } + return ElementwiseNotEqualsImplementation(value); + } + /// + public override PrimitiveDataFrameColumn ElementwiseGreaterThanOrEqual(DataFrameColumn column) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn byteColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn charColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn decimalColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn doubleColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn floatColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn intColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn longColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn sbyteColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn shortColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn uintColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ulongColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ushortColumn: + return ElementwiseGreaterThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ElementwiseGreaterThanOrEqual(U value) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return ElementwiseGreaterThanOrEqual(column); + } + return ElementwiseGreaterThanOrEqualImplementation(value); + } + /// + public override PrimitiveDataFrameColumn ElementwiseLessThanOrEqual(DataFrameColumn column) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn byteColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn charColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn decimalColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn doubleColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn floatColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn intColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn longColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn sbyteColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn shortColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn uintColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ulongColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ushortColumn: + return ElementwiseLessThanOrEqualImplementation(column as PrimitiveDataFrameColumn); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ElementwiseLessThanOrEqual(U value) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return ElementwiseLessThanOrEqual(column); + } + return ElementwiseLessThanOrEqualImplementation(value); + } + /// + public override PrimitiveDataFrameColumn ElementwiseGreaterThan(DataFrameColumn column) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn byteColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn charColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn decimalColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn doubleColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn floatColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn intColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn longColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn sbyteColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn shortColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn uintColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ulongColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ushortColumn: + return ElementwiseGreaterThanImplementation(column as PrimitiveDataFrameColumn); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ElementwiseGreaterThan(U value) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return ElementwiseGreaterThan(column); + } + return ElementwiseGreaterThanImplementation(value); + } + /// + public override PrimitiveDataFrameColumn ElementwiseLessThan(DataFrameColumn column) + { + switch (column) + { + case PrimitiveDataFrameColumn boolColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn byteColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn charColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn decimalColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn doubleColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn floatColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn intColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn longColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn sbyteColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn shortColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn uintColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ulongColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + case PrimitiveDataFrameColumn ushortColumn: + return ElementwiseLessThanImplementation(column as PrimitiveDataFrameColumn); + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ElementwiseLessThan(U value) + { + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return ElementwiseLessThan(column); + } + return ElementwiseLessThanImplementation(value); + } + + internal DataFrameColumn AddImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Add(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Add(column.CloneAsDecimalColumn()._columnContainer); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Add(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Add((column as PrimitiveDataFrameColumn)._columnContainer); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Add(column.CloneAsDoubleColumn()._columnContainer); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn AddImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Add(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Add(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Add(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Add(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Add(DoubleConverter.Instance.GetDouble(value)); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn SubtractImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Subtract(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Subtract(column.CloneAsDecimalColumn()._columnContainer); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Subtract(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Subtract((column as PrimitiveDataFrameColumn)._columnContainer); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Subtract(column.CloneAsDoubleColumn()._columnContainer); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn SubtractImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Subtract(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Subtract(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Subtract(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Subtract(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Subtract(DoubleConverter.Instance.GetDouble(value)); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn MultiplyImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Multiply(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Multiply(column.CloneAsDecimalColumn()._columnContainer); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Multiply(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Multiply((column as PrimitiveDataFrameColumn)._columnContainer); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Multiply(column.CloneAsDoubleColumn()._columnContainer); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn MultiplyImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Multiply(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Multiply(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Multiply(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Multiply(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Multiply(DoubleConverter.Instance.GetDouble(value)); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn DivideImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Divide(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Divide(column.CloneAsDecimalColumn()._columnContainer); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Divide(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Divide((column as PrimitiveDataFrameColumn)._columnContainer); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Divide(column.CloneAsDoubleColumn()._columnContainer); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn DivideImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Divide(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Divide(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Divide(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Divide(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Divide(DoubleConverter.Instance.GetDouble(value)); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn ModuloImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Modulo(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Modulo(column.CloneAsDecimalColumn()._columnContainer); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Modulo(column._columnContainer); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Modulo((column as PrimitiveDataFrameColumn)._columnContainer); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Modulo(column.CloneAsDoubleColumn()._columnContainer); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn ModuloImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Modulo(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Modulo(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = inPlace ? primitiveColumn : primitiveColumn.Clone(); + newColumn._columnContainer.Modulo(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Modulo(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.Modulo(DoubleConverter.Instance.GetDouble(value)); + return doubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn AndImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = inPlace ? typedColumn : typedColumn.Clone(); + retColumn._columnContainer.And(column._columnContainer); + return retColumn; + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type decimalType when decimalType == typeof(decimal): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn AndImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = inPlace ? typedColumn : typedColumn.Clone(); + retColumn._columnContainer.And(Unsafe.As(ref value)); + return retColumn as PrimitiveDataFrameColumn; + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type decimalType when decimalType == typeof(decimal): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn OrImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = inPlace ? typedColumn : typedColumn.Clone(); + retColumn._columnContainer.Or(column._columnContainer); + return retColumn; + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type decimalType when decimalType == typeof(decimal): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn OrImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = inPlace ? typedColumn : typedColumn.Clone(); + retColumn._columnContainer.Or(Unsafe.As(ref value)); + return retColumn as PrimitiveDataFrameColumn; + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type decimalType when decimalType == typeof(decimal): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn XorImplementation(PrimitiveDataFrameColumn column, bool inPlace) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = inPlace ? typedColumn : typedColumn.Clone(); + retColumn._columnContainer.Xor(column._columnContainer); + return retColumn; + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type decimalType when decimalType == typeof(decimal): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn XorImplementation(U value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = inPlace ? typedColumn : typedColumn.Clone(); + retColumn._columnContainer.Xor(Unsafe.As(ref value)); + return retColumn as PrimitiveDataFrameColumn; + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type decimalType when decimalType == typeof(decimal): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn LeftShiftImplementation(int value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type byteType when byteType == typeof(byte): + PrimitiveDataFrameColumn byteColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newbyteColumn = inPlace ? byteColumn : byteColumn.Clone(); + newbyteColumn._columnContainer.LeftShift(value); + return newbyteColumn; + case Type charType when charType == typeof(char): + PrimitiveDataFrameColumn charColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newcharColumn = inPlace ? charColumn : charColumn.Clone(); + newcharColumn._columnContainer.LeftShift(value); + return newcharColumn; + case Type decimalType when decimalType == typeof(decimal): + throw new NotSupportedException(); + case Type doubleType when doubleType == typeof(double): + throw new NotSupportedException(); + case Type floatType when floatType == typeof(float): + throw new NotSupportedException(); + case Type intType when intType == typeof(int): + PrimitiveDataFrameColumn intColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newintColumn = inPlace ? intColumn : intColumn.Clone(); + newintColumn._columnContainer.LeftShift(value); + return newintColumn; + case Type longType when longType == typeof(long): + PrimitiveDataFrameColumn longColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newlongColumn = inPlace ? longColumn : longColumn.Clone(); + newlongColumn._columnContainer.LeftShift(value); + return newlongColumn; + case Type sbyteType when sbyteType == typeof(sbyte): + PrimitiveDataFrameColumn sbyteColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newsbyteColumn = inPlace ? sbyteColumn : sbyteColumn.Clone(); + newsbyteColumn._columnContainer.LeftShift(value); + return newsbyteColumn; + case Type shortType when shortType == typeof(short): + PrimitiveDataFrameColumn shortColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newshortColumn = inPlace ? shortColumn : shortColumn.Clone(); + newshortColumn._columnContainer.LeftShift(value); + return newshortColumn; + case Type uintType when uintType == typeof(uint): + PrimitiveDataFrameColumn uintColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newuintColumn = inPlace ? uintColumn : uintColumn.Clone(); + newuintColumn._columnContainer.LeftShift(value); + return newuintColumn; + case Type ulongType when ulongType == typeof(ulong): + PrimitiveDataFrameColumn ulongColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newulongColumn = inPlace ? ulongColumn : ulongColumn.Clone(); + newulongColumn._columnContainer.LeftShift(value); + return newulongColumn; + case Type ushortType when ushortType == typeof(ushort): + PrimitiveDataFrameColumn ushortColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newushortColumn = inPlace ? ushortColumn : ushortColumn.Clone(); + newushortColumn._columnContainer.LeftShift(value); + return newushortColumn; + default: + throw new NotSupportedException(); + } + } + internal DataFrameColumn RightShiftImplementation(int value, bool inPlace) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type byteType when byteType == typeof(byte): + PrimitiveDataFrameColumn byteColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newbyteColumn = inPlace ? byteColumn : byteColumn.Clone(); + newbyteColumn._columnContainer.RightShift(value); + return newbyteColumn; + case Type charType when charType == typeof(char): + PrimitiveDataFrameColumn charColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newcharColumn = inPlace ? charColumn : charColumn.Clone(); + newcharColumn._columnContainer.RightShift(value); + return newcharColumn; + case Type decimalType when decimalType == typeof(decimal): + throw new NotSupportedException(); + case Type doubleType when doubleType == typeof(double): + throw new NotSupportedException(); + case Type floatType when floatType == typeof(float): + throw new NotSupportedException(); + case Type intType when intType == typeof(int): + PrimitiveDataFrameColumn intColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newintColumn = inPlace ? intColumn : intColumn.Clone(); + newintColumn._columnContainer.RightShift(value); + return newintColumn; + case Type longType when longType == typeof(long): + PrimitiveDataFrameColumn longColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newlongColumn = inPlace ? longColumn : longColumn.Clone(); + newlongColumn._columnContainer.RightShift(value); + return newlongColumn; + case Type sbyteType when sbyteType == typeof(sbyte): + PrimitiveDataFrameColumn sbyteColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newsbyteColumn = inPlace ? sbyteColumn : sbyteColumn.Clone(); + newsbyteColumn._columnContainer.RightShift(value); + return newsbyteColumn; + case Type shortType when shortType == typeof(short): + PrimitiveDataFrameColumn shortColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newshortColumn = inPlace ? shortColumn : shortColumn.Clone(); + newshortColumn._columnContainer.RightShift(value); + return newshortColumn; + case Type uintType when uintType == typeof(uint): + PrimitiveDataFrameColumn uintColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newuintColumn = inPlace ? uintColumn : uintColumn.Clone(); + newuintColumn._columnContainer.RightShift(value); + return newuintColumn; + case Type ulongType when ulongType == typeof(ulong): + PrimitiveDataFrameColumn ulongColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newulongColumn = inPlace ? ulongColumn : ulongColumn.Clone(); + newulongColumn._columnContainer.RightShift(value); + return newulongColumn; + case Type ushortType when ushortType == typeof(ushort): + PrimitiveDataFrameColumn ushortColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newushortColumn = inPlace ? ushortColumn : ushortColumn.Clone(); + newushortColumn._columnContainer.RightShift(value); + return newushortColumn; + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseEqualsImplementation(PrimitiveDataFrameColumn column) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn retColumn = CloneAsBooleanColumn(); + (this as PrimitiveDataFrameColumn)._columnContainer.ElementwiseEquals(column._columnContainer, retColumn._columnContainer); + return retColumn; + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseEquals(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseEquals(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseEquals(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseEquals((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseEquals(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseEqualsImplementation(U value) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn retColumn = CloneAsBooleanColumn(); + (this as PrimitiveDataFrameColumn)._columnContainer.ElementwiseEquals(Unsafe.As(ref value), retColumn._columnContainer); + return retColumn; + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseEquals(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseEquals(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseEquals(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseEquals(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseEquals(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseNotEqualsImplementation(PrimitiveDataFrameColumn column) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn retColumn = CloneAsBooleanColumn(); + (this as PrimitiveDataFrameColumn)._columnContainer.ElementwiseNotEquals(column._columnContainer, retColumn._columnContainer); + return retColumn; + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseNotEquals(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseNotEquals(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseNotEquals(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseNotEquals((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseNotEquals(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseNotEqualsImplementation(U value) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } + PrimitiveDataFrameColumn retColumn = CloneAsBooleanColumn(); + (this as PrimitiveDataFrameColumn)._columnContainer.ElementwiseNotEquals(Unsafe.As(ref value), retColumn._columnContainer); + return retColumn; + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseNotEquals(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseNotEquals(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseNotEquals(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseNotEquals(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseNotEquals(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(PrimitiveDataFrameColumn column) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThanOrEqual(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThanOrEqual(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThanOrEqual(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThanOrEqual((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseGreaterThanOrEqual(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseGreaterThanOrEqualImplementation(U value) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThanOrEqual(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThanOrEqual(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThanOrEqual(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThanOrEqual(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseGreaterThanOrEqual(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseLessThanOrEqualImplementation(PrimitiveDataFrameColumn column) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThanOrEqual(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThanOrEqual(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThanOrEqual(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThanOrEqual((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseLessThanOrEqual(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseLessThanOrEqualImplementation(U value) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThanOrEqual(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThanOrEqual(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThanOrEqual(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThanOrEqual(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseLessThanOrEqual(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseGreaterThanImplementation(PrimitiveDataFrameColumn column) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThan(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThan(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThan(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThan((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseGreaterThan(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseGreaterThanImplementation(U value) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThan(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThan(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseGreaterThan(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseGreaterThan(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseGreaterThan(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseLessThanImplementation(PrimitiveDataFrameColumn column) + where U : unmanaged + { + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThan(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThan(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThan(column._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThan((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseLessThan(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + internal PrimitiveDataFrameColumn ElementwiseLessThanImplementation(U value) + { + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + throw new NotSupportedException(); + case Type decimalType when decimalType == typeof(decimal): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThan(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThan(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.ElementwiseLessThan(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; + } + else + { + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ElementwiseLessThan(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; + } + else + { + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.ElementwiseLessThan(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; + } + } + default: + throw new NotSupportedException(); + } + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.tt new file mode 100644 index 0000000000..6809de48d1 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperations.tt @@ -0,0 +1,388 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.BinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.Binary || method.MethodType == MethodType.Comparison) {#> +<# if (method.MethodType == MethodType.Binary) {#> + /// + public override DataFrameColumn <#=method.MethodName#>(DataFrameColumn column, bool inPlace = false) +<# } else { #> + /// + public override PrimitiveDataFrameColumn <#=method.MethodName#>(DataFrameColumn column) +<# } #> + { + switch (column) + { +<# foreach (TypeConfiguration type in typeConfiguration) { #> + case PrimitiveDataFrameColumn<<#=type.TypeName#>> <#=type.TypeName#>Column: +<# if (method.MethodType == MethodType.Binary) {#> + return <#=method.MethodName#>Implementation(column as PrimitiveDataFrameColumn<<#=type.TypeName#>>, inPlace); +<# } else { #> + return <#=method.MethodName#>Implementation(column as PrimitiveDataFrameColumn<<#=type.TypeName#>>); +<# } #> +<# } #> + default: + throw new NotSupportedException(); + } + } +<# } #> +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.ComparisonScalar) {#> +<# if (method.MethodType == MethodType.BinaryScalar) {#> +<# if (method.IsBitwise == true) { #> + /// + public override PrimitiveDataFrameColumn <#=method.MethodName#>(bool value, bool inPlace = false) +<# } else { #> + /// + public override DataFrameColumn <#=method.MethodName#>(U value, bool inPlace = false) +<# } #> +<# } else {#> + /// + public override PrimitiveDataFrameColumn <#=method.MethodName#>(U value) +<# } #> + { +<# if (method.MethodType == MethodType.BinaryScalar) {#> +<# if (method.IsBitwise == true) { #> + return <#=method.MethodName#>Implementation(value, inPlace); +<# } else { #> + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return <#=method.MethodName#>(column, inPlace); + } + return <#=method.MethodName#>Implementation(value, inPlace); +<# } #> +<# } else {#> + DataFrameColumn column = value as DataFrameColumn; + if (column != null) + { + return <#=method.MethodName#>(column); + } + return <#=method.MethodName#>Implementation(value); +<# } #> + } +<# } #> +<# if (method.MethodType == MethodType.BinaryInt ) {#> + /// + public override DataFrameColumn <#=method.MethodName#>(int value, bool inPlace = false) + { + return <#=method.MethodName#>Implementation(value, inPlace); + } +<# } #> +<# } #> + +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.ComparisonScalar) {#> +<# if (method.MethodType == MethodType.BinaryScalar) {#> +<# if (method.IsBitwise == true) { #> + internal PrimitiveDataFrameColumn <#=method.MethodName#>Implementation(U value, bool inPlace) +<# } else { #> + internal DataFrameColumn <#=method.MethodName#>Implementation(U value, bool inPlace) +<# } #> +<# } else {#> + internal PrimitiveDataFrameColumn <#=method.MethodName#>Implementation(U value) +<# } #> +<# } #> +<# if (method.MethodType == MethodType.Binary || method.MethodType == MethodType.Comparison) {#> +<# if (method.MethodType == MethodType.Binary) {#> + internal DataFrameColumn <#=method.MethodName#>Implementation(PrimitiveDataFrameColumn column, bool inPlace) +<# } else { #> + internal PrimitiveDataFrameColumn <#=method.MethodName#>Implementation(PrimitiveDataFrameColumn column) +<# } #> + where U : unmanaged +<# } #> +<# if (method.MethodType == MethodType.BinaryInt ) {#> + internal DataFrameColumn <#=method.MethodName#>Implementation(int value, bool inPlace) +<# } #> + { +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.BinaryInt) {#> +<# } else { #> + if (column.Length != Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } +<# } #> +<# if (method.MethodType == MethodType.BinaryInt ) {#> + switch (typeof(T)) + { +<# foreach (TypeConfiguration type in typeConfiguration) { #> + case Type <#=type.TypeName#>Type when <#=type.TypeName#>Type == typeof(<#=type.TypeName#>): +<# if (type.TypeName == "bool" || type.SupportsBitwise == false) { #> + throw new NotSupportedException(); +<# } else { #> + PrimitiveDataFrameColumn<<#=type.TypeName#>> <#=type.TypeName#>Column = this as PrimitiveDataFrameColumn<<#=type.TypeName#>>; + PrimitiveDataFrameColumn<<#=type.TypeName#>> new<#=type.TypeName#>Column = inPlace ? <#=type.TypeName#>Column : <#=type.TypeName#>Column.Clone(); + new<#=type.TypeName#>Column._columnContainer.<#=method.MethodName#>(value); + return new<#=type.TypeName#>Column; +<# } #> +<# } #> + default: + throw new NotSupportedException(); + } +<# } else if (method.IsBitwise == true && method.IsNumeric == false) { #> + switch (typeof(T)) + { + case Type boolType when boolType == typeof(bool): + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } +<# if (method.MethodType == MethodType.BinaryScalar) {#> + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = <#=GenerateInPlaceStatement("typedColumn", "typedColumn.Clone()")#>; + retColumn._columnContainer.<#=method.MethodName#>(Unsafe.As(ref value)); + return retColumn as PrimitiveDataFrameColumn; +<# } else { #> + PrimitiveDataFrameColumn typedColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = <#=GenerateInPlaceStatement("typedColumn", "typedColumn.Clone()")#>; + retColumn._columnContainer.<#=method.MethodName#>(column._columnContainer); + return retColumn; +<# } #> +<# foreach (TypeConfiguration type in typeConfiguration) { #> +<# if (type.TypeName == "bool") { #> +<# } else { #> + case Type <#=type.TypeName#>Type when <#=type.TypeName#>Type == typeof(<#=type.TypeName#>): +<# } #> +<# } #> + default: + throw new NotSupportedException(); + } +<# } else { #> + switch (typeof(T)) + { +<# foreach (TypeConfiguration type in typeConfiguration) { #> +<# if (type.TypeName == "bool") { #> + case Type <#=type.TypeName#>Type when <#=type.TypeName#>Type == typeof(<#=type.TypeName#>): +<# if (method.IsNumeric == true) { #> + throw new NotSupportedException(); +<# } else { #> + if (typeof(U) != typeof(bool)) + { + throw new NotSupportedException(); + } +<# if (method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.Comparison) { #> + PrimitiveDataFrameColumn retColumn = CloneAsBooleanColumn(); +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + (this as PrimitiveDataFrameColumn)._columnContainer.<#=method.MethodName#>(Unsafe.As(ref value), retColumn._columnContainer); +<# } else { #> + (this as PrimitiveDataFrameColumn)._columnContainer.<#=method.MethodName#>(column._columnContainer, retColumn._columnContainer); +<# } #> +<# } else if (method.MethodType == MethodType.BinaryScalar) {#> + PrimitiveDataFrameColumn column = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = <#=GenerateInPlaceStatement("column", "column.Clone()")#>; + retColumn._columnContainer.<#=method.MethodName#>(value); +<# } else { #> + PrimitiveDataFrameColumn column = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn retColumn = <#=GenerateInPlaceStatement("column", "column.Clone()")#>; + retColumn._columnContainer.<#=method.MethodName#>(column._columnContainer); +<# } #> + return retColumn; +<# } #> +<# } else if (type.TypeName == "decimal") { #> + case Type <#=type.TypeName#>Type when <#=type.TypeName#>Type == typeof(<#=type.TypeName#>): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions +<# if (method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.Comparison) { #> +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.<#=method.MethodName#>(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.<#=method.MethodName#>(column._columnContainer, newColumn._columnContainer); + return newColumn; +<# } #> +<# } else if (method.IsBitwise == true ) { #> + throw new NotSupportedException(); +<# } else if (method.MethodType == MethodType.BinaryScalar ) { #> + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = <#=GenerateInPlaceStatement("primitiveColumn", "primitiveColumn.Clone()")#>; + newColumn._columnContainer.<#=method.MethodName#>(Unsafe.As(ref value)); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = <#=GenerateInPlaceStatement("primitiveColumn", "primitiveColumn.Clone()")#>; + newColumn._columnContainer.<#=method.MethodName#>(column._columnContainer); + return newColumn; +<# } #> + } + else + { +<# if (method.MethodType == MethodType.BinaryScalar) { #> + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } +<# } else if (method.MethodType == MethodType.Binary) { #> + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } +<# } #> +<# if (method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.Comparison) { #> + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>(column.CloneAsDecimalColumn()._columnContainer, newColumn._columnContainer); + return newColumn; +<# } #> +<# } else if (method.IsBitwise == true) { #> + throw new NotSupportedException(); +<# } else if (method.MethodType == MethodType.BinaryScalar) { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; +<# } else { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>(column.CloneAsDecimalColumn()._columnContainer); + return decimalColumn; +<# } #> + } +<# } else { #> +<# } #> +<# } #> + case Type byteType when byteType == typeof(byte): + case Type charType when charType == typeof(char): + case Type doubleType when doubleType == typeof(double): + case Type floatType when floatType == typeof(float): + case Type intType when intType == typeof(int): + case Type longType when longType == typeof(long): + case Type sbyteType when sbyteType == typeof(sbyte): + case Type shortType when shortType == typeof(short): + case Type uintType when uintType == typeof(uint): + case Type ulongType when ulongType == typeof(ulong): + case Type ushortType when ushortType == typeof(ushort): + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions +<# if (method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.Comparison) { #> +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.<#=method.MethodName#>(Unsafe.As(ref value), newColumn._columnContainer); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); + primitiveColumn._columnContainer.<#=method.MethodName#>(column._columnContainer, newColumn._columnContainer); + return newColumn; +<# } #> +<# } else if (method.IsBitwise == true ) { #> + throw new NotSupportedException(); +<# } else if (method.MethodType == MethodType.BinaryScalar ) { #> + PrimitiveDataFrameColumn primitiveColumn = this; + PrimitiveDataFrameColumn newColumn = <#=GenerateInPlaceStatement("primitiveColumn", "primitiveColumn.Clone()")#>; + newColumn._columnContainer.<#=method.MethodName#>(Unsafe.As(ref value)); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn primitiveColumn = this as PrimitiveDataFrameColumn; + PrimitiveDataFrameColumn newColumn = <#=GenerateInPlaceStatement("primitiveColumn", "primitiveColumn.Clone()")#>; + newColumn._columnContainer.<#=method.MethodName#>(column._columnContainer); + return newColumn; +<# } #> + } + else + { +<# if (method.MethodType == MethodType.BinaryScalar) { #> + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } +<# } else if (method.MethodType == MethodType.Binary) { #> + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedColumnValueType, typeof(T)), nameof(column)); + } +<# } #> + if (typeof(U) == typeof(decimal)) + { +<# if (method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.Comparison) { #> + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>(DecimalConverter.Instance.GetDecimal(value), newColumn._columnContainer); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>((column as PrimitiveDataFrameColumn)._columnContainer, newColumn._columnContainer); + return newColumn; +<# } #> +<# } else if (method.IsBitwise == true) { #> + throw new NotSupportedException(); +<# } else if (method.MethodType == MethodType.BinaryScalar) { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; +<# } else { #> + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.<#=method.MethodName#>((column as PrimitiveDataFrameColumn)._columnContainer); + return decimalColumn; +<# } #> + } + else + { +<# if (method.MethodType == MethodType.ComparisonScalar || method.MethodType == MethodType.Comparison) { #> + PrimitiveDataFrameColumn newColumn = CloneAsBooleanColumn(); +<# if (method.MethodType == MethodType.ComparisonScalar) { #> + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.<#=method.MethodName#>(DoubleConverter.Instance.GetDouble(value), newColumn._columnContainer); + return newColumn; +<# } else { #> + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.<#=method.MethodName#>(column.CloneAsDoubleColumn()._columnContainer, newColumn._columnContainer); + return newColumn; +<# } #> +<# } else if (method.IsBitwise == true) { #> + throw new NotSupportedException(); +<# } else if (method.MethodType == MethodType.BinaryScalar ) { #> + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.<#=method.MethodName#>(DoubleConverter.Instance.GetDouble(value)); + return doubleColumn; +<# } else { #> + PrimitiveDataFrameColumn doubleColumn = CloneAsDoubleColumn(); + doubleColumn._columnContainer.<#=method.MethodName#>(column.CloneAsDoubleColumn()._columnContainer); + return doubleColumn; +<# } #> + } + } + default: + throw new NotSupportedException(); + } +<# } #> + } +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperators.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperators.cs new file mode 100644 index 0000000000..ab89c880d9 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperators.cs @@ -0,0 +1,7397 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(ByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(ByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(ByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(ByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(ByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(ByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(SingleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(Int32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(Int32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(Int32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(Int32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(Int64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(Int64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(Int64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(SByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(SByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(SByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(SByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(SByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(Int16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(Int16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(Int16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(Int16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(Int16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator +(UInt32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(UInt32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(UInt32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(UInt32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(UInt32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(UInt32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(UInt32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(UInt64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(UInt64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(UInt16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(UInt16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(UInt16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(UInt16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(UInt16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(UInt16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Add(right); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, byte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(byte left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(ByteDataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(ByteDataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(ByteDataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(int left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(ByteDataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(sbyte left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(short left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt32DataFrameColumn operator +(ByteDataFrameColumn left, uint right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(uint left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt64DataFrameColumn operator +(ByteDataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(ulong left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(ByteDataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ushort left, ByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, byte right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(byte left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, int right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(int left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, long right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(long left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(sbyte left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, short right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(short left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, uint right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(uint left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(ulong left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(DecimalDataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(ushort left, DecimalDataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, byte right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(byte left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, float right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(float left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, int right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(int left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, long right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(long left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(sbyte left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, short right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(short left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, uint right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(uint left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(ulong left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(DoubleDataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(ushort left, DoubleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, byte right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(byte left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(SingleDataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, int right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(int left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, long right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(long left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(sbyte left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, short right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(short left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, uint right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(uint left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(ulong left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SingleDataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(ushort left, SingleDataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, byte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(byte left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(Int32DataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(Int32DataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(Int32DataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(int left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int32DataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(sbyte left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(short left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int32DataFrameColumn left, uint right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(uint left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(Int32DataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(ulong left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int32DataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ushort left, Int32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, byte right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(byte left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(Int64DataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(Int64DataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(Int64DataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(int left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(sbyte left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(short left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, uint right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(uint left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int64DataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(ushort left, Int64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, byte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(byte left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(SByteDataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(SByteDataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SByteDataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(int left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(SByteDataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(sbyte left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(short left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(SByteDataFrameColumn left, uint right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(uint left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(SByteDataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(ulong left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(SByteDataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ushort left, SByteDataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, byte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(byte left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(Int16DataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(Int16DataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(Int16DataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(int left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int16DataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(sbyte left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(short left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(Int16DataFrameColumn left, uint right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(uint left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(Int16DataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(ulong left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(Int16DataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ushort left, Int16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator +(UInt32DataFrameColumn left, byte right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(byte left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(UInt32DataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(UInt32DataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(UInt32DataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(int left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(sbyte left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(UInt32DataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(short left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt32DataFrameColumn operator +(UInt32DataFrameColumn left, uint right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(uint left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt64DataFrameColumn operator +(UInt32DataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(ulong left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt32DataFrameColumn operator +(UInt32DataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(ushort left, UInt32DataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, byte right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(byte left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(UInt64DataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(UInt64DataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, int right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(int left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(sbyte left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(UInt64DataFrameColumn left, short right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(short left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, uint right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(uint left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(ulong left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt64DataFrameColumn operator +(UInt64DataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(ushort left, UInt64DataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, byte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(byte left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DecimalDataFrameColumn operator +(UInt16DataFrameColumn left, decimal right) + { + return left.Add(right); + } + public static DecimalDataFrameColumn operator +(decimal left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static DoubleDataFrameColumn operator +(UInt16DataFrameColumn left, double right) + { + return left.Add(right); + } + public static DoubleDataFrameColumn operator +(double left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static SingleDataFrameColumn operator +(UInt16DataFrameColumn left, float right) + { + return left.Add(right); + } + public static SingleDataFrameColumn operator +(float left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, int right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(int left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int64DataFrameColumn operator +(UInt16DataFrameColumn left, long right) + { + return left.Add(right); + } + public static Int64DataFrameColumn operator +(long left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, sbyte right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(sbyte left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, short right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(short left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt32DataFrameColumn operator +(UInt16DataFrameColumn left, uint right) + { + return left.Add(right); + } + public static UInt32DataFrameColumn operator +(uint left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static UInt64DataFrameColumn operator +(UInt16DataFrameColumn left, ulong right) + { + return left.Add(right); + } + public static UInt64DataFrameColumn operator +(ulong left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + public static Int32DataFrameColumn operator +(UInt16DataFrameColumn left, ushort right) + { + return left.Add(right); + } + public static Int32DataFrameColumn operator +(ushort left, UInt16DataFrameColumn right) + { + return right.ReverseAdd(left); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(ByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(ByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(ByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(ByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(ByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(ByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(SingleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(Int32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(Int32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(Int32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(Int32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(Int64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(Int64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(Int64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(SByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(SByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(SByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(SByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(SByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(Int16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(Int16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(Int16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(Int16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(Int16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator -(UInt32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(UInt32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(UInt32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(UInt32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(UInt32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(UInt32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(UInt32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(UInt64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(UInt64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(UInt16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(UInt16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(UInt16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(UInt16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(UInt16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(UInt16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Subtract(right); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(byte left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(ByteDataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(ByteDataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(ByteDataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(int left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(ByteDataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(sbyte left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(short left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt32DataFrameColumn operator -(ByteDataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(uint left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt64DataFrameColumn operator -(ByteDataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(ulong left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(ByteDataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ushort left, ByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(byte left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(int left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(long left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(sbyte left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(short left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(uint left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(ulong left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(DecimalDataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(ushort left, DecimalDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(byte left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(float left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(int left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(long left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(sbyte left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(short left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(uint left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(ulong left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(DoubleDataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(ushort left, DoubleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(byte left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(SingleDataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(int left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(long left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(sbyte left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(short left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(uint left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(ulong left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SingleDataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(ushort left, SingleDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(byte left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(Int32DataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(Int32DataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(Int32DataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(int left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int32DataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(sbyte left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(short left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int32DataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(uint left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(Int32DataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(ulong left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int32DataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ushort left, Int32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(byte left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(Int64DataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(Int64DataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(Int64DataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(int left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(sbyte left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(short left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(uint left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int64DataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(ushort left, Int64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(byte left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(SByteDataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(SByteDataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SByteDataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(int left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(SByteDataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(sbyte left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(short left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(SByteDataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(uint left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(SByteDataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(ulong left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(SByteDataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ushort left, SByteDataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(byte left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(Int16DataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(Int16DataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(Int16DataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(int left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int16DataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(sbyte left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(short left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(Int16DataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(uint left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(Int16DataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(ulong left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(Int16DataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ushort left, Int16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator -(UInt32DataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(byte left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(UInt32DataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(UInt32DataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(UInt32DataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(int left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(sbyte left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(UInt32DataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(short left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt32DataFrameColumn operator -(UInt32DataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(uint left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt64DataFrameColumn operator -(UInt32DataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(ulong left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt32DataFrameColumn operator -(UInt32DataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(ushort left, UInt32DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(byte left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(UInt64DataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(UInt64DataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(int left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(sbyte left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(UInt64DataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(short left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(uint left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(ulong left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt64DataFrameColumn operator -(UInt64DataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(ushort left, UInt64DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, byte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(byte left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DecimalDataFrameColumn operator -(UInt16DataFrameColumn left, decimal right) + { + return left.Subtract(right); + } + public static DecimalDataFrameColumn operator -(decimal left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static DoubleDataFrameColumn operator -(UInt16DataFrameColumn left, double right) + { + return left.Subtract(right); + } + public static DoubleDataFrameColumn operator -(double left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static SingleDataFrameColumn operator -(UInt16DataFrameColumn left, float right) + { + return left.Subtract(right); + } + public static SingleDataFrameColumn operator -(float left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, int right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(int left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int64DataFrameColumn operator -(UInt16DataFrameColumn left, long right) + { + return left.Subtract(right); + } + public static Int64DataFrameColumn operator -(long left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, sbyte right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(sbyte left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, short right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(short left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt32DataFrameColumn operator -(UInt16DataFrameColumn left, uint right) + { + return left.Subtract(right); + } + public static UInt32DataFrameColumn operator -(uint left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static UInt64DataFrameColumn operator -(UInt16DataFrameColumn left, ulong right) + { + return left.Subtract(right); + } + public static UInt64DataFrameColumn operator -(ulong left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + public static Int32DataFrameColumn operator -(UInt16DataFrameColumn left, ushort right) + { + return left.Subtract(right); + } + public static Int32DataFrameColumn operator -(ushort left, UInt16DataFrameColumn right) + { + return right.ReverseSubtract(left); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(ByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(ByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(ByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(ByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(ByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(ByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(SingleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(Int32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(Int32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(Int32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(Int32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(Int64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(Int64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(Int64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(SByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(SByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(SByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(SByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(SByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(Int16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(Int16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(Int16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(Int16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(Int16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator *(UInt32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(UInt32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(UInt32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(UInt32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(UInt32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(UInt32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(UInt32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(UInt64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(UInt64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(UInt16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(UInt16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(UInt16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(UInt16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(UInt16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(UInt16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Multiply(right); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(byte left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(ByteDataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(ByteDataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(ByteDataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(int left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(ByteDataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(sbyte left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(short left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt32DataFrameColumn operator *(ByteDataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(uint left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt64DataFrameColumn operator *(ByteDataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(ulong left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(ByteDataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ushort left, ByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(byte left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(int left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(long left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(sbyte left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(short left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(uint left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(ulong left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(DecimalDataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(ushort left, DecimalDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(byte left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(float left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(int left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(long left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(sbyte left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(short left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(uint left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(ulong left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(DoubleDataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(ushort left, DoubleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(byte left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(SingleDataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(int left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(long left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(sbyte left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(short left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(uint left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(ulong left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SingleDataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(ushort left, SingleDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(byte left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(Int32DataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(Int32DataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(Int32DataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(int left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int32DataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(sbyte left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(short left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int32DataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(uint left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(Int32DataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(ulong left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int32DataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ushort left, Int32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(byte left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(Int64DataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(Int64DataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(Int64DataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(int left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(sbyte left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(short left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(uint left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int64DataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(ushort left, Int64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(byte left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(SByteDataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(SByteDataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SByteDataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(int left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(SByteDataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(sbyte left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(short left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(SByteDataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(uint left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(SByteDataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(ulong left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(SByteDataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ushort left, SByteDataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(byte left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(Int16DataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(Int16DataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(Int16DataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(int left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int16DataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(sbyte left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(short left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(Int16DataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(uint left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(Int16DataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(ulong left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(Int16DataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ushort left, Int16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator *(UInt32DataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(byte left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(UInt32DataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(UInt32DataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(UInt32DataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(int left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(sbyte left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(UInt32DataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(short left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt32DataFrameColumn operator *(UInt32DataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(uint left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt64DataFrameColumn operator *(UInt32DataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(ulong left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt32DataFrameColumn operator *(UInt32DataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(ushort left, UInt32DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(byte left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(UInt64DataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(UInt64DataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(int left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(sbyte left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(UInt64DataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(short left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(uint left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(ulong left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt64DataFrameColumn operator *(UInt64DataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(ushort left, UInt64DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, byte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(byte left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DecimalDataFrameColumn operator *(UInt16DataFrameColumn left, decimal right) + { + return left.Multiply(right); + } + public static DecimalDataFrameColumn operator *(decimal left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static DoubleDataFrameColumn operator *(UInt16DataFrameColumn left, double right) + { + return left.Multiply(right); + } + public static DoubleDataFrameColumn operator *(double left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static SingleDataFrameColumn operator *(UInt16DataFrameColumn left, float right) + { + return left.Multiply(right); + } + public static SingleDataFrameColumn operator *(float left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, int right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(int left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int64DataFrameColumn operator *(UInt16DataFrameColumn left, long right) + { + return left.Multiply(right); + } + public static Int64DataFrameColumn operator *(long left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, sbyte right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(sbyte left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, short right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(short left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt32DataFrameColumn operator *(UInt16DataFrameColumn left, uint right) + { + return left.Multiply(right); + } + public static UInt32DataFrameColumn operator *(uint left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static UInt64DataFrameColumn operator *(UInt16DataFrameColumn left, ulong right) + { + return left.Multiply(right); + } + public static UInt64DataFrameColumn operator *(ulong left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + public static Int32DataFrameColumn operator *(UInt16DataFrameColumn left, ushort right) + { + return left.Multiply(right); + } + public static Int32DataFrameColumn operator *(ushort left, UInt16DataFrameColumn right) + { + return right.ReverseMultiply(left); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(ByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(ByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(ByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(ByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(ByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(ByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(SingleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(Int32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(Int32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(Int32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(Int32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(Int64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(Int64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(Int64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(SByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(SByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(SByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(SByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(SByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(Int16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(Int16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(Int16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(Int16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(Int16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator /(UInt32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(UInt32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(UInt32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(UInt32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(UInt32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(UInt32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(UInt32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(UInt64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(UInt64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(UInt16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(UInt16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(UInt16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(UInt16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(UInt16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(UInt16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Divide(right); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(byte left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(ByteDataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(ByteDataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(ByteDataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(int left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(ByteDataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(sbyte left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(short left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt32DataFrameColumn operator /(ByteDataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(uint left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt64DataFrameColumn operator /(ByteDataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(ulong left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(ByteDataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ushort left, ByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(byte left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, int right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(int left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, long right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(long left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(sbyte left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, short right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(short left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(uint left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(ulong left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(DecimalDataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(ushort left, DecimalDataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(byte left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, float right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(float left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, int right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(int left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, long right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(long left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(sbyte left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, short right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(short left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(uint left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(ulong left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(DoubleDataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(ushort left, DoubleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(byte left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(SingleDataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, int right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(int left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, long right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(long left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(sbyte left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, short right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(short left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(uint left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(ulong left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SingleDataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(ushort left, SingleDataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(byte left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(Int32DataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(Int32DataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(Int32DataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(int left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int32DataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(sbyte left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(short left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int32DataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(uint left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(Int32DataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(ulong left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int32DataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ushort left, Int32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(byte left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(Int64DataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(Int64DataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(Int64DataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(int left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(sbyte left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(short left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(uint left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int64DataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(ushort left, Int64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(byte left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(SByteDataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(SByteDataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SByteDataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(int left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(SByteDataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(sbyte left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(short left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(SByteDataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(uint left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(SByteDataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(ulong left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(SByteDataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ushort left, SByteDataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(byte left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(Int16DataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(Int16DataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(Int16DataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(int left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int16DataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(sbyte left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(short left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(Int16DataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(uint left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(Int16DataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(ulong left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(Int16DataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ushort left, Int16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator /(UInt32DataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(byte left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(UInt32DataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(UInt32DataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(UInt32DataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(int left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(sbyte left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(UInt32DataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(short left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt32DataFrameColumn operator /(UInt32DataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(uint left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt64DataFrameColumn operator /(UInt32DataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(ulong left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt32DataFrameColumn operator /(UInt32DataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(ushort left, UInt32DataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(byte left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(UInt64DataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(UInt64DataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, int right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(int left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(sbyte left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(UInt64DataFrameColumn left, short right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(short left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(uint left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(ulong left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt64DataFrameColumn operator /(UInt64DataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(ushort left, UInt64DataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, byte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(byte left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DecimalDataFrameColumn operator /(UInt16DataFrameColumn left, decimal right) + { + return left.Divide(right); + } + public static DecimalDataFrameColumn operator /(decimal left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static DoubleDataFrameColumn operator /(UInt16DataFrameColumn left, double right) + { + return left.Divide(right); + } + public static DoubleDataFrameColumn operator /(double left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static SingleDataFrameColumn operator /(UInt16DataFrameColumn left, float right) + { + return left.Divide(right); + } + public static SingleDataFrameColumn operator /(float left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, int right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(int left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int64DataFrameColumn operator /(UInt16DataFrameColumn left, long right) + { + return left.Divide(right); + } + public static Int64DataFrameColumn operator /(long left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, sbyte right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(sbyte left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, short right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(short left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt32DataFrameColumn operator /(UInt16DataFrameColumn left, uint right) + { + return left.Divide(right); + } + public static UInt32DataFrameColumn operator /(uint left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static UInt64DataFrameColumn operator /(UInt16DataFrameColumn left, ulong right) + { + return left.Divide(right); + } + public static UInt64DataFrameColumn operator /(ulong left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + public static Int32DataFrameColumn operator /(UInt16DataFrameColumn left, ushort right) + { + return left.Divide(right); + } + public static Int32DataFrameColumn operator /(ushort left, UInt16DataFrameColumn right) + { + return right.ReverseDivide(left); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(ByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(ByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(ByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(ByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(ByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(ByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(SingleDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(Int32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(Int32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(Int32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(Int32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(Int64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(Int64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(Int64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(SByteDataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(SByteDataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SByteDataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(SByteDataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(SByteDataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(SByteDataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(Int16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(Int16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(Int16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(Int16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(Int16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator %(UInt32DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(UInt32DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(UInt32DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(UInt32DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(UInt32DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(UInt32DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(UInt32DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(UInt64DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(UInt64DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, ByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(UInt16DataFrameColumn left, DecimalDataFrameColumn right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(UInt16DataFrameColumn left, DoubleDataFrameColumn right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(UInt16DataFrameColumn left, SingleDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, Int32DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(UInt16DataFrameColumn left, Int64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, SByteDataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, Int16DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(UInt16DataFrameColumn left, UInt32DataFrameColumn right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(UInt16DataFrameColumn left, UInt64DataFrameColumn right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, UInt16DataFrameColumn right) + { + return left.Modulo(right); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(byte left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(ByteDataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(ByteDataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(ByteDataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(int left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(ByteDataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(sbyte left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(short left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt32DataFrameColumn operator %(ByteDataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(uint left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt64DataFrameColumn operator %(ByteDataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(ulong left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(ByteDataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ushort left, ByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class DecimalDataFrameColumn + { + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(byte left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(int left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(long left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(sbyte left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(short left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(uint left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(ulong left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(DecimalDataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(ushort left, DecimalDataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class DoubleDataFrameColumn + { + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(byte left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(float left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(int left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(long left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(sbyte left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(short left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(uint left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(ulong left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(DoubleDataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(ushort left, DoubleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class SingleDataFrameColumn + { + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(byte left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(SingleDataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(int left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(long left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(sbyte left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(short left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(uint left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(ulong left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SingleDataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(ushort left, SingleDataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(byte left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(Int32DataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(Int32DataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(Int32DataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(int left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int32DataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(sbyte left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(short left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int32DataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(uint left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(Int32DataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(ulong left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int32DataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ushort left, Int32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(byte left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(Int64DataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(Int64DataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(Int64DataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(int left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(sbyte left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(short left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(uint left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int64DataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(ushort left, Int64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(byte left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(SByteDataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(SByteDataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SByteDataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(int left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(SByteDataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(sbyte left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(short left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(SByteDataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(uint left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(SByteDataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(ulong left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(SByteDataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ushort left, SByteDataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(byte left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(Int16DataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(Int16DataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(Int16DataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(int left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int16DataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(sbyte left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(short left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(Int16DataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(uint left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(Int16DataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(ulong left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(Int16DataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ushort left, Int16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator %(UInt32DataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(byte left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(UInt32DataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(UInt32DataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(UInt32DataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(int left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(sbyte left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(UInt32DataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(short left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt32DataFrameColumn operator %(UInt32DataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(uint left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt64DataFrameColumn operator %(UInt32DataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(ulong left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt32DataFrameColumn operator %(UInt32DataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(ushort left, UInt32DataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(byte left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(UInt64DataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(UInt64DataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(int left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(sbyte left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(UInt64DataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(short left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(uint left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(ulong left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt64DataFrameColumn operator %(UInt64DataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(ushort left, UInt64DataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, byte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(byte left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DecimalDataFrameColumn operator %(UInt16DataFrameColumn left, decimal right) + { + return left.Modulo(right); + } + public static DecimalDataFrameColumn operator %(decimal left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static DoubleDataFrameColumn operator %(UInt16DataFrameColumn left, double right) + { + return left.Modulo(right); + } + public static DoubleDataFrameColumn operator %(double left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static SingleDataFrameColumn operator %(UInt16DataFrameColumn left, float right) + { + return left.Modulo(right); + } + public static SingleDataFrameColumn operator %(float left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, int right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(int left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int64DataFrameColumn operator %(UInt16DataFrameColumn left, long right) + { + return left.Modulo(right); + } + public static Int64DataFrameColumn operator %(long left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, sbyte right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(sbyte left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, short right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(short left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt32DataFrameColumn operator %(UInt16DataFrameColumn left, uint right) + { + return left.Modulo(right); + } + public static UInt32DataFrameColumn operator %(uint left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static UInt64DataFrameColumn operator %(UInt16DataFrameColumn left, ulong right) + { + return left.Modulo(right); + } + public static UInt64DataFrameColumn operator %(ulong left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + public static Int32DataFrameColumn operator %(UInt16DataFrameColumn left, ushort right) + { + return left.Modulo(right); + } + public static Int32DataFrameColumn operator %(ushort left, UInt16DataFrameColumn right) + { + return right.ReverseModulo(left); + } + } + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator &(BooleanDataFrameColumn left, BooleanDataFrameColumn right) + { + return left.And(right); + } + } + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator &(BooleanDataFrameColumn left, bool right) + { + return left.And(right); + } + } + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator |(BooleanDataFrameColumn left, BooleanDataFrameColumn right) + { + return left.Or(right); + } + } + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator |(BooleanDataFrameColumn left, bool right) + { + return left.Or(right); + } + } + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator ^(BooleanDataFrameColumn left, BooleanDataFrameColumn right) + { + return left.Xor(right); + } + } + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator ^(BooleanDataFrameColumn left, bool right) + { + return left.Xor(right); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator <<(ByteDataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator <<(Int32DataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator <<(Int64DataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator <<(SByteDataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator <<(Int16DataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator <<(UInt32DataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator <<(UInt64DataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator <<(UInt16DataFrameColumn left, int value) + { + return left.LeftShift(value); + } + } + public partial class ByteDataFrameColumn + { + public static Int32DataFrameColumn operator >>(ByteDataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class Int32DataFrameColumn + { + public static Int32DataFrameColumn operator >>(Int32DataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class Int64DataFrameColumn + { + public static Int64DataFrameColumn operator >>(Int64DataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class SByteDataFrameColumn + { + public static Int32DataFrameColumn operator >>(SByteDataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class Int16DataFrameColumn + { + public static Int32DataFrameColumn operator >>(Int16DataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class UInt32DataFrameColumn + { + public static UInt32DataFrameColumn operator >>(UInt32DataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class UInt64DataFrameColumn + { + public static UInt64DataFrameColumn operator >>(UInt64DataFrameColumn left, int value) + { + return left.RightShift(value); + } + } + public partial class UInt16DataFrameColumn + { + public static Int32DataFrameColumn operator >>(UInt16DataFrameColumn left, int value) + { + return left.RightShift(value); + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperators.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperators.tt new file mode 100644 index 0000000000..777dc4026d --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.BinaryOperators.tt @@ -0,0 +1,236 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +<#@ include file="PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ +<# +void GenerateAllBinaryCombinationsForOperator(string op, string methodName) +{ + HashSet visited = new HashSet { }; + foreach (TypeCombination outer in BinaryOperationCombinations.binaryOperationCombinations) + { + string outerColumnType = outer.ThisColumnType; + if (visited.Contains(outerColumnType)) + { + continue; + } + visited.Add(outerColumnType); + string fullOuterColumnType = GetCapitalizedPrimitiveTypes(outerColumnType) + "DataFrameColumn"; +#> + public partial class <#=fullOuterColumnType#> + { +<# + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations.Where((ACombination) => ACombination.ThisColumnType == outerColumnType)) + { + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; +#> + public static <#=fullReturnType#> operator <#=op#>(<#=fullColumnType#> left, <#=fullOtherColumnType#> right) + { + return left.<#=methodName#>(right); + } +<# + } +#> + } +<# +} +} +#> +<# +void GenerateAllBinaryScalarCombinationsForOperator(string op, string methodName) +{ + HashSet visited = new HashSet { }; + foreach (TypeCombination outer in BinaryOperationCombinations.binaryOperationCombinations) + { + string outerColumnType = outer.ThisColumnType; + if (visited.Contains(outerColumnType)) + { + continue; + } + visited.Add(outerColumnType); + string fullOuterColumnType = GetCapitalizedPrimitiveTypes(outerColumnType) + "DataFrameColumn"; +#> + public partial class <#=fullOuterColumnType#> + { +<# + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations.Where((ACombination) => ACombination.ThisColumnType == outerColumnType)) + { + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; +#> + public static <#=fullReturnType#> operator <#=op#>(<#=fullColumnType#> left, <#=otherColumnType#> right) + { + return left.<#=methodName#>(right); + } + public static <#=fullReturnType#> operator <#=op#>(<#=otherColumnType#> left, <#=fullColumnType#> right) + { + return right.Reverse<#=methodName#>(left); + } +<# + } +#> + } +<# +} +} +#> +<# +void GenerateAllBinaryBitwiseCombinationsForOperator(string op, string methodName) +{ +#> + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator <#=op#>(BooleanDataFrameColumn left, BooleanDataFrameColumn right) + { + return left.<#=methodName#>(right); + } + } +<# +} +#> +<# +void GenerateAllBinaryScalarBitwiseCombinationsForOperator(string op, string methodName) +{ +#> + public partial class BooleanDataFrameColumn + { + public static BooleanDataFrameColumn operator <#=op#>(BooleanDataFrameColumn left, bool right) + { + return left.<#=methodName#>(right); + } + } +<# +} +#> +<# +void GenerateAllBinaryIntBitwiseCombinationsForOperator(string op, string methodName) +{ + foreach (var type in typeConfiguration) + { + if (!type.SupportsNumeric || !type.SupportsBitwise || type.TypeName == "char") + { + continue; + } + string returnType = GetBinaryShiftOperationReturnType(type); + if (returnType == string.Empty) + { + continue; + } + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullColumnType = GetCapitalizedPrimitiveTypes(type.TypeName) + "DataFrameColumn"; + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); +#> + public partial class <#=fullColumnType#> + { + public static <#=fullReturnType#> operator <#=op#>(<#=fullColumnType#> left, int value) + { + return left.<#=methodName#>(value); + } + } +<# + } +} +#> +<# +void GenerateAllComparisonCombinationsForOperator(string op, string methodName) +{ + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations) + { + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + +#> + public partial class <#=fullColumnType#> + { + public static <#=fullReturnType#> operator <#=op#>(<#=fullColumnType#> left, <#=fullOtherColumnType#> right) + { + return left.<#=methodName#>(right); + } + } +<# + } + } +#> +<# +void GenerateAllComparisonScalarCombinationsForOperator(string op, string methodName) +{ + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations) + { + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + +#> + public partial class <#=fullColumnType#> + { + public static <#=fullReturnType#> operator <#=op#>(<#=fullColumnType#> left, <#=otherColumnType#> right) + { + return left.<#=methodName#>(right); + } + } +<# + } + } +#> +<# +foreach (MethodConfiguration method in methodConfiguration) +{ + // Don't generate method for Comparison and ComparisonScalar methods here + if (method.MethodType == MethodType.Binary && method.IsNumeric) + { + GenerateAllBinaryCombinationsForOperator(method.Operator, method.MethodName); + } + else if (method.MethodType == MethodType.BinaryScalar && method.IsNumeric) + { + GenerateAllBinaryScalarCombinationsForOperator(method.Operator, method.MethodName); + } + else if (method.MethodType == MethodType.Binary && method.IsBitwise) + { + GenerateAllBinaryBitwiseCombinationsForOperator(method.Operator, method.MethodName); + } + else if (method.MethodType == MethodType.BinaryScalar && method.IsBitwise) + { + GenerateAllBinaryScalarBitwiseCombinationsForOperator(method.Operator, method.MethodName); + } + else if (method.MethodType == MethodType.BinaryInt) + { + GenerateAllBinaryIntBitwiseCombinationsForOperator(method.Operator, method.MethodName); + } +} +#> +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Computations.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Computations.cs new file mode 100644 index 0000000000..58e6a1e7c5 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Computations.cs @@ -0,0 +1,149 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.Computations.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { + /// + public override DataFrameColumn Abs(bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.Abs(ret._columnContainer); + return ret; + } + /// + public override bool All() + { + PrimitiveColumnComputation.Instance.All(_columnContainer, out bool ret); + return ret; + } + /// + public override bool Any() + { + PrimitiveColumnComputation.Instance.Any(_columnContainer, out bool ret); + return ret; + } + /// + public override DataFrameColumn CumulativeMax(bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeMax(ret._columnContainer); + return ret; + } + /// + public override DataFrameColumn CumulativeMax(IEnumerable rowIndices, bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeMax(ret._columnContainer, rowIndices); + return ret; + } + /// + public override DataFrameColumn CumulativeMin(bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeMin(ret._columnContainer); + return ret; + } + /// + public override DataFrameColumn CumulativeMin(IEnumerable rowIndices, bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeMin(ret._columnContainer, rowIndices); + return ret; + } + /// + public override DataFrameColumn CumulativeProduct(bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeProduct(ret._columnContainer); + return ret; + } + /// + public override DataFrameColumn CumulativeProduct(IEnumerable rowIndices, bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeProduct(ret._columnContainer, rowIndices); + return ret; + } + /// + public override DataFrameColumn CumulativeSum(bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeSum(ret._columnContainer); + return ret; + } + /// + public override DataFrameColumn CumulativeSum(IEnumerable rowIndices, bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.CumulativeSum(ret._columnContainer, rowIndices); + return ret; + } + /// + public override object Max() + { + PrimitiveColumnComputation.Instance.Max(_columnContainer, out T ret); + return ret; + } + /// + public override object Max(IEnumerable rowIndices) + { + PrimitiveColumnComputation.Instance.Max(_columnContainer, rowIndices, out T ret); + return ret; + } + /// + public override object Min() + { + PrimitiveColumnComputation.Instance.Min(_columnContainer, out T ret); + return ret; + } + /// + public override object Min(IEnumerable rowIndices) + { + PrimitiveColumnComputation.Instance.Min(_columnContainer, rowIndices, out T ret); + return ret; + } + /// + public override object Product() + { + PrimitiveColumnComputation.Instance.Product(_columnContainer, out T ret); + return ret; + } + /// + public override object Product(IEnumerable rowIndices) + { + PrimitiveColumnComputation.Instance.Product(_columnContainer, rowIndices, out T ret); + return ret; + } + /// + public override object Sum() + { + PrimitiveColumnComputation.Instance.Sum(_columnContainer, out T ret); + return ret; + } + /// + public override object Sum(IEnumerable rowIndices) + { + PrimitiveColumnComputation.Instance.Sum(_columnContainer, rowIndices, out T ret); + return ret; + } + /// + public override DataFrameColumn Round(bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + PrimitiveColumnComputation.Instance.Round(ret._columnContainer); + return ret; + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Computations.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Computations.tt new file mode 100644 index 0000000000..0d09ea3e37 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Computations.tt @@ -0,0 +1,69 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.Computations.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { +<# foreach (MethodConfiguration compMethod in computationMethodConfiguration) { #> +<# if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false && compMethod.SupportsRowSubsets == true) {#> + /// + public override DataFrameColumn <#=compMethod.MethodName#>(IEnumerable rowIndices, bool inPlace = false) +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false) {#> + /// + public override DataFrameColumn <#=compMethod.MethodName#>(bool inPlace = false) +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == true) {#> + /// + public override object <#=compMethod.MethodName#>() +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true && compMethod.SupportsRowSubsets == true) { #> + /// + public override object <#=compMethod.MethodName#>(IEnumerable rowIndices) +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true) { #> + /// + public override object <#=compMethod.MethodName#>() +<# } else { #> + /// + public override bool <#=compMethod.MethodName#>() +<# } #> + { +<# if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false && compMethod.SupportsRowSubsets == true) {#> + PrimitiveDataFrameColumn ret = <#=GenerateInPlaceStatement("this", "Clone()")#>; + PrimitiveColumnComputation.Instance.<#=compMethod.MethodName#>(ret._columnContainer, rowIndices); + return ret; +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false) {#> + PrimitiveDataFrameColumn ret = <#=GenerateInPlaceStatement("this", "Clone()")#>; + PrimitiveColumnComputation.Instance.<#=compMethod.MethodName#>(ret._columnContainer); + return ret; +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == true) {#> + PrimitiveColumnComputation.Instance.<#=compMethod.MethodName#>(_columnContainer, out T ret); + return ret; +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true && compMethod.SupportsRowSubsets == true) { #> + PrimitiveColumnComputation.Instance.<#=compMethod.MethodName#>(_columnContainer, rowIndices, out T ret); + return ret; +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true) { #> + PrimitiveColumnComputation.Instance.<#=compMethod.MethodName#>(_columnContainer, out T ret); + return ret; +<# } else { #> + PrimitiveColumnComputation.Instance.<#=compMethod.MethodName#>(_columnContainer, out bool ret); + return ret; +<# } #> + } +<# } #> + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.ReversedBinaryOperations.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.ReversedBinaryOperations.cs new file mode 100644 index 0000000000..ba04893e7e --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.ReversedBinaryOperations.cs @@ -0,0 +1,433 @@ + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.ReversedBinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { + + /// + public override DataFrameColumn ReverseAdd(U value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + throw new NotSupportedException(); + case PrimitiveDataFrameColumn decimalColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseAdd(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn clonedDecimalColumn = CloneAsDecimalColumn(); + clonedDecimalColumn._columnContainer.ReverseAdd(DecimalConverter.Instance.GetDecimal(value)); + return clonedDecimalColumn; + } + case PrimitiveDataFrameColumn byteColumn: + case PrimitiveDataFrameColumn charColumn: + case PrimitiveDataFrameColumn doubleColumn: + case PrimitiveDataFrameColumn floatColumn: + case PrimitiveDataFrameColumn intColumn: + case PrimitiveDataFrameColumn longColumn: + case PrimitiveDataFrameColumn sbyteColumn: + case PrimitiveDataFrameColumn shortColumn: + case PrimitiveDataFrameColumn uintColumn: + case PrimitiveDataFrameColumn ulongColumn: + case PrimitiveDataFrameColumn ushortColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseAdd(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ReverseAdd(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn clonedDoubleColumn = CloneAsDoubleColumn(); + clonedDoubleColumn._columnContainer.ReverseAdd(DoubleConverter.Instance.GetDouble(value)); + return clonedDoubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn ReverseSubtract(U value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + throw new NotSupportedException(); + case PrimitiveDataFrameColumn decimalColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseSubtract(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn clonedDecimalColumn = CloneAsDecimalColumn(); + clonedDecimalColumn._columnContainer.ReverseSubtract(DecimalConverter.Instance.GetDecimal(value)); + return clonedDecimalColumn; + } + case PrimitiveDataFrameColumn byteColumn: + case PrimitiveDataFrameColumn charColumn: + case PrimitiveDataFrameColumn doubleColumn: + case PrimitiveDataFrameColumn floatColumn: + case PrimitiveDataFrameColumn intColumn: + case PrimitiveDataFrameColumn longColumn: + case PrimitiveDataFrameColumn sbyteColumn: + case PrimitiveDataFrameColumn shortColumn: + case PrimitiveDataFrameColumn uintColumn: + case PrimitiveDataFrameColumn ulongColumn: + case PrimitiveDataFrameColumn ushortColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseSubtract(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ReverseSubtract(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn clonedDoubleColumn = CloneAsDoubleColumn(); + clonedDoubleColumn._columnContainer.ReverseSubtract(DoubleConverter.Instance.GetDouble(value)); + return clonedDoubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn ReverseMultiply(U value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + throw new NotSupportedException(); + case PrimitiveDataFrameColumn decimalColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseMultiply(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn clonedDecimalColumn = CloneAsDecimalColumn(); + clonedDecimalColumn._columnContainer.ReverseMultiply(DecimalConverter.Instance.GetDecimal(value)); + return clonedDecimalColumn; + } + case PrimitiveDataFrameColumn byteColumn: + case PrimitiveDataFrameColumn charColumn: + case PrimitiveDataFrameColumn doubleColumn: + case PrimitiveDataFrameColumn floatColumn: + case PrimitiveDataFrameColumn intColumn: + case PrimitiveDataFrameColumn longColumn: + case PrimitiveDataFrameColumn sbyteColumn: + case PrimitiveDataFrameColumn shortColumn: + case PrimitiveDataFrameColumn uintColumn: + case PrimitiveDataFrameColumn ulongColumn: + case PrimitiveDataFrameColumn ushortColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseMultiply(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ReverseMultiply(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn clonedDoubleColumn = CloneAsDoubleColumn(); + clonedDoubleColumn._columnContainer.ReverseMultiply(DoubleConverter.Instance.GetDouble(value)); + return clonedDoubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn ReverseDivide(U value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + throw new NotSupportedException(); + case PrimitiveDataFrameColumn decimalColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseDivide(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn clonedDecimalColumn = CloneAsDecimalColumn(); + clonedDecimalColumn._columnContainer.ReverseDivide(DecimalConverter.Instance.GetDecimal(value)); + return clonedDecimalColumn; + } + case PrimitiveDataFrameColumn byteColumn: + case PrimitiveDataFrameColumn charColumn: + case PrimitiveDataFrameColumn doubleColumn: + case PrimitiveDataFrameColumn floatColumn: + case PrimitiveDataFrameColumn intColumn: + case PrimitiveDataFrameColumn longColumn: + case PrimitiveDataFrameColumn sbyteColumn: + case PrimitiveDataFrameColumn shortColumn: + case PrimitiveDataFrameColumn uintColumn: + case PrimitiveDataFrameColumn ulongColumn: + case PrimitiveDataFrameColumn ushortColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseDivide(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ReverseDivide(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn clonedDoubleColumn = CloneAsDoubleColumn(); + clonedDoubleColumn._columnContainer.ReverseDivide(DoubleConverter.Instance.GetDouble(value)); + return clonedDoubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + /// + public override DataFrameColumn ReverseModulo(U value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + throw new NotSupportedException(); + case PrimitiveDataFrameColumn decimalColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseModulo(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn clonedDecimalColumn = CloneAsDecimalColumn(); + clonedDecimalColumn._columnContainer.ReverseModulo(DecimalConverter.Instance.GetDecimal(value)); + return clonedDecimalColumn; + } + case PrimitiveDataFrameColumn byteColumn: + case PrimitiveDataFrameColumn charColumn: + case PrimitiveDataFrameColumn doubleColumn: + case PrimitiveDataFrameColumn floatColumn: + case PrimitiveDataFrameColumn intColumn: + case PrimitiveDataFrameColumn longColumn: + case PrimitiveDataFrameColumn sbyteColumn: + case PrimitiveDataFrameColumn shortColumn: + case PrimitiveDataFrameColumn uintColumn: + case PrimitiveDataFrameColumn ulongColumn: + case PrimitiveDataFrameColumn ushortColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.ReverseModulo(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.ReverseModulo(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn clonedDoubleColumn = CloneAsDoubleColumn(); + clonedDoubleColumn._columnContainer.ReverseModulo(DoubleConverter.Instance.GetDouble(value)); + return clonedDoubleColumn; + } + } + default: + throw new NotSupportedException(); + } + } + /// + public override PrimitiveDataFrameColumn ReverseAnd(bool value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + PrimitiveDataFrameColumn retColumn = inPlace ? boolColumn : boolColumn.Clone(); + retColumn._columnContainer.ReverseAnd(value); + return retColumn; + default: + throw new NotSupportedException(); + + } + } + /// + public override PrimitiveDataFrameColumn ReverseOr(bool value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + PrimitiveDataFrameColumn retColumn = inPlace ? boolColumn : boolColumn.Clone(); + retColumn._columnContainer.ReverseOr(value); + return retColumn; + default: + throw new NotSupportedException(); + + } + } + /// + public override PrimitiveDataFrameColumn ReverseXor(bool value, bool inPlace = false) + { + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + PrimitiveDataFrameColumn retColumn = inPlace ? boolColumn : boolColumn.Clone(); + retColumn._columnContainer.ReverseXor(value); + return retColumn; + default: + throw new NotSupportedException(); + + } + } + + + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.ReversedBinaryOperations.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.ReversedBinaryOperations.tt new file mode 100644 index 0000000000..68382f5b92 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.ReversedBinaryOperations.tt @@ -0,0 +1,119 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumn.ReversedBinaryOperations.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { + +<# foreach (MethodConfiguration method in methodConfiguration) { #> +<# if (method.MethodType == MethodType.BinaryScalar) {#> +<# if (method.IsBitwise == true) { #> + /// + public override PrimitiveDataFrameColumn Reverse<#=method.MethodName#>(bool value, bool inPlace = false) +<# } else { #> + /// + public override DataFrameColumn Reverse<#=method.MethodName#>(U value, bool inPlace = false) +<# } #> + { +<# if (method.IsBitwise == true) { #> + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + PrimitiveDataFrameColumn retColumn = inPlace ? boolColumn : boolColumn.Clone(); + retColumn._columnContainer.Reverse<#=method.MethodName#>(value); + return retColumn; + default: + throw new NotSupportedException(); + + } +<# } else { #> + switch (this) + { + case PrimitiveDataFrameColumn boolColumn: + throw new NotSupportedException(); + case PrimitiveDataFrameColumn decimalColumn: + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.Reverse<#=method.MethodName#>(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + PrimitiveDataFrameColumn clonedDecimalColumn = CloneAsDecimalColumn(); + clonedDecimalColumn._columnContainer.Reverse<#=method.MethodName#>(DecimalConverter.Instance.GetDecimal(value)); + return clonedDecimalColumn; + } +<# foreach (TypeConfiguration type in typeConfiguration) { #> +<# if (type.TypeName == "bool") { #> +<# } else if (type.TypeName == "decimal") { #> +<# } else { #> + case PrimitiveDataFrameColumn<<#=type.TypeName#>> <#=type.TypeName#>Column: +<# } #> +<# } #> + if (typeof(U) == typeof(bool)) + { + throw new NotSupportedException(); + } + if (typeof(U) == typeof(T)) + { + // No conversions + PrimitiveDataFrameColumn newColumn = inPlace ? this : Clone(); + newColumn._columnContainer.Reverse<#=method.MethodName#>(Unsafe.As(ref value)); + return newColumn; + } + else + { + if (inPlace) + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(value)); + } + if (typeof(U) == typeof(decimal)) + { + PrimitiveDataFrameColumn decimalColumn = CloneAsDecimalColumn(); + decimalColumn._columnContainer.Reverse<#=method.MethodName#>(DecimalConverter.Instance.GetDecimal(value)); + return decimalColumn; + } + else + { + PrimitiveDataFrameColumn clonedDoubleColumn = CloneAsDoubleColumn(); + clonedDoubleColumn._columnContainer.Reverse<#=method.MethodName#>(DoubleConverter.Instance.GetDouble(value)); + return clonedDoubleColumn; + } + } + default: + throw new NotSupportedException(); + } +<# } #> + } +<# } #> +<# } #> + + + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Sort.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Sort.cs new file mode 100644 index 0000000000..60f7e21046 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.Sort.cs @@ -0,0 +1,100 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Microsoft.Data.Analysis +{ + public partial class PrimitiveDataFrameColumn : DataFrameColumn + where T : unmanaged + { + public new PrimitiveDataFrameColumn Sort(bool ascending = true) + { + PrimitiveDataFrameColumn sortIndices = GetAscendingSortIndices(); + return Clone(sortIndices, !ascending, NullCount); + } + + internal override PrimitiveDataFrameColumn GetAscendingSortIndices() + { + // The return sortIndices contains only the non null indices. + GetSortIndices(Comparer.Default, out PrimitiveDataFrameColumn sortIndices); + return sortIndices; + } + + private void GetSortIndices(IComparer comparer, out PrimitiveDataFrameColumn columnSortIndices) + { + List> bufferSortIndices = new List>(_columnContainer.Buffers.Count); + // Sort each buffer first + for (int b = 0; b < _columnContainer.Buffers.Count; b++) + { + ReadOnlyDataFrameBuffer buffer = _columnContainer.Buffers[b]; + ReadOnlySpan nullBitMapSpan = _columnContainer.NullBitMapBuffers[b].ReadOnlySpan; + int[] sortIndices = new int[buffer.Length]; + for (int i = 0; i < buffer.Length; i++) + sortIndices[i] = i; + IntrospectiveSort(buffer.ReadOnlySpan, buffer.Length, sortIndices, comparer); + // Bug fix: QuickSort is not stable. When PrimitiveDataFrameColumn has null values and default values, they move around + List nonNullSortIndices = new List(); + for (int i = 0; i < sortIndices.Length; i++) + { + if (_columnContainer.IsValid(nullBitMapSpan, sortIndices[i])) + nonNullSortIndices.Add(sortIndices[i]); + + } + bufferSortIndices.Add(nonNullSortIndices); + } + // Simple merge sort to build the full column's sort indices + ValueTuple GetFirstNonNullValueAndBufferIndexStartingAtIndex(int bufferIndex, int startIndex) + { + int index = bufferSortIndices[bufferIndex][startIndex]; + T value; + ReadOnlyMemory buffer = _columnContainer.Buffers[bufferIndex].ReadOnlyBuffer; + ReadOnlyMemory typedBuffer = Unsafe.As, ReadOnlyMemory>(ref buffer); + if (!typedBuffer.IsEmpty) + { + bool isArray = MemoryMarshal.TryGetArray(typedBuffer, out ArraySegment arraySegment); + if (isArray) + { + value = arraySegment.Array[index + arraySegment.Offset]; + } + else + value = _columnContainer.Buffers[bufferIndex][index]; + } + else + { + value = _columnContainer.Buffers[bufferIndex][index]; + } + return (value, startIndex); + } + SortedDictionary>> heapOfValueAndListOfTupleOfSortAndBufferIndex = new SortedDictionary>>(comparer); + IList> buffers = _columnContainer.Buffers; + for (int i = 0; i < buffers.Count; i++) + { + ReadOnlyDataFrameBuffer buffer = buffers[i]; + if (bufferSortIndices[i].Count == 0) + { + // All nulls + continue; + } + ValueTuple valueAndBufferIndex = GetFirstNonNullValueAndBufferIndexStartingAtIndex(i, 0); + if (heapOfValueAndListOfTupleOfSortAndBufferIndex.ContainsKey(valueAndBufferIndex.Item1)) + { + heapOfValueAndListOfTupleOfSortAndBufferIndex[valueAndBufferIndex.Item1].Add((valueAndBufferIndex.Item2, i)); + } + else + { + heapOfValueAndListOfTupleOfSortAndBufferIndex.Add(valueAndBufferIndex.Item1, new List>() { (valueAndBufferIndex.Item2, i) }); + } + } + columnSortIndices = new PrimitiveDataFrameColumn("SortIndices"); + GetBufferSortIndex getBufferSortIndex = new GetBufferSortIndex((int bufferIndex, int sortIndex) => (bufferSortIndices[bufferIndex][sortIndex]) + bufferIndex * bufferSortIndices[0].Count); + GetValueAndBufferSortIndexAtBuffer getValueAndBufferSortIndexAtBuffer = new GetValueAndBufferSortIndexAtBuffer((int bufferIndex, int sortIndex) => GetFirstNonNullValueAndBufferIndexStartingAtIndex(bufferIndex, sortIndex)); + GetBufferLengthAtIndex getBufferLengthAtIndex = new GetBufferLengthAtIndex((int bufferIndex) => bufferSortIndices[bufferIndex].Count); + PopulateColumnSortIndicesWithHeap(heapOfValueAndListOfTupleOfSortAndBufferIndex, columnSortIndices, getBufferSortIndex, getValueAndBufferSortIndexAtBuffer, getBufferLengthAtIndex); + } + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs new file mode 100644 index 0000000000..613644a346 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumn.cs @@ -0,0 +1,779 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using Apache.Arrow; +using Apache.Arrow.Types; +using Microsoft.ML; +using Microsoft.ML.Data; + +namespace Microsoft.Data.Analysis +{ + /// + /// A column to hold primitive types such as int, float etc. + /// + /// + public partial class PrimitiveDataFrameColumn : DataFrameColumn, IEnumerable + where T : unmanaged + { + private PrimitiveColumnContainer _columnContainer; + + internal PrimitiveColumnContainer ColumnContainer => _columnContainer; + + internal PrimitiveDataFrameColumn(string name, PrimitiveColumnContainer column) : base(name, column.Length, typeof(T)) + { + _columnContainer = column; + } + + public PrimitiveDataFrameColumn(string name, IEnumerable values) : base(name, 0, typeof(T)) + { + _columnContainer = new PrimitiveColumnContainer(values); + Length = _columnContainer.Length; + } + + public PrimitiveDataFrameColumn(string name, IEnumerable values) : base(name, 0, typeof(T)) + { + _columnContainer = new PrimitiveColumnContainer(values); + Length = _columnContainer.Length; + } + + public PrimitiveDataFrameColumn(string name, long length = 0) : base(name, length, typeof(T)) + { + _columnContainer = new PrimitiveColumnContainer(length); + } + + public PrimitiveDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, length, typeof(T)) + { + _columnContainer = new PrimitiveColumnContainer(buffer, nullBitMap, length, nullCount); + } + + /// + /// Returns an enumerable of immutable memory buffers representing the underlying values + /// + /// values are encoded in the buffers returned by GetReadOnlyNullBitmapBuffers in the Apache Arrow format + /// IEnumerable + public IEnumerable> GetReadOnlyDataBuffers() + { + for (int i = 0; i < _columnContainer.Buffers.Count; i++) + { + ReadOnlyDataFrameBuffer buffer = _columnContainer.Buffers[i]; + yield return buffer.ReadOnlyMemory; + } + } + + /// + /// Returns an enumerable of immutable buffers representing values in the Apache Arrow format + /// + /// Each encodes the values for its corresponding Data buffer + /// IEnumerable + public IEnumerable> GetReadOnlyNullBitMapBuffers() + { + for (int i = 0; i < _columnContainer.NullBitMapBuffers.Count; i++) + { + ReadOnlyDataFrameBuffer buffer = _columnContainer.NullBitMapBuffers[i]; + yield return buffer.RawReadOnlyMemory; + } + } + + private IArrowType GetArrowType() + { + if (typeof(T) == typeof(bool)) + return BooleanType.Default; + else if (typeof(T) == typeof(double)) + return DoubleType.Default; + else if (typeof(T) == typeof(float)) + return FloatType.Default; + else if (typeof(T) == typeof(sbyte)) + return Int8Type.Default; + else if (typeof(T) == typeof(int)) + return Int32Type.Default; + else if (typeof(T) == typeof(long)) + return Int64Type.Default; + else if (typeof(T) == typeof(short)) + return Int16Type.Default; + else if (typeof(T) == typeof(byte)) + return UInt8Type.Default; + else if (typeof(T) == typeof(uint)) + return UInt32Type.Default; + else if (typeof(T) == typeof(ulong)) + return UInt64Type.Default; + else if (typeof(T) == typeof(ushort)) + return UInt16Type.Default; + else + throw new NotImplementedException(nameof(T)); + } + + protected internal override Field GetArrowField() => new Field(Name, GetArrowType(), NullCount != 0); + + protected internal override int GetMaxRecordBatchLength(long startIndex) => _columnContainer.MaxRecordBatchLength(startIndex); + + private int GetNullCount(long startIndex, int numberOfRows) + { + int nullCount = 0; + for (long i = startIndex; i < numberOfRows; i++) + { + if (!IsValid(i)) + nullCount++; + } + return nullCount; + } + + protected internal override Apache.Arrow.Array ToArrowArray(long startIndex, int numberOfRows) + { + int arrayIndex = numberOfRows == 0 ? 0 : _columnContainer.GetArrayContainingRowIndex(startIndex); + int offset = (int)(startIndex - arrayIndex * ReadOnlyDataFrameBuffer.MaxCapacity); + if (numberOfRows != 0 && numberOfRows > _columnContainer.Buffers[arrayIndex].Length - offset) + { + throw new ArgumentException(Strings.SpansMultipleBuffers, nameof(numberOfRows)); + } + ArrowBuffer valueBuffer = numberOfRows == 0 ? ArrowBuffer.Empty : new ArrowBuffer(_columnContainer.GetValueBuffer(startIndex)); + ArrowBuffer nullBuffer = numberOfRows == 0 ? ArrowBuffer.Empty : new ArrowBuffer(_columnContainer.GetNullBuffer(startIndex)); + int nullCount = GetNullCount(startIndex, numberOfRows); + Type type = this.DataType; + if (type == typeof(bool)) + return new BooleanArray(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(double)) + return new DoubleArray(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(float)) + return new FloatArray(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(int)) + return new Int32Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(long)) + return new Int64Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(sbyte)) + return new Int8Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(short)) + return new Int16Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(uint)) + return new UInt32Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(ulong)) + return new UInt64Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(ushort)) + return new UInt16Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else if (type == typeof(byte)) + return new UInt8Array(valueBuffer, nullBuffer, numberOfRows, nullCount, offset); + else + throw new NotImplementedException(type.ToString()); + } + + public new IReadOnlyList this[long startIndex, int length] + { + get + { + if (startIndex > Length) + { + throw new ArgumentOutOfRangeException(nameof(startIndex)); + } + return _columnContainer[startIndex, length]; + } + } + + protected override IReadOnlyList GetValues(long startIndex, int length) + { + if (startIndex > Length) + { + throw new ArgumentOutOfRangeException(nameof(startIndex)); + } + + var ret = new List(length); + long endIndex = Math.Min(Length, startIndex + length); + for (long i = startIndex; i < endIndex; i++) + { + ret.Add(this[i]); + } + return ret; + } + + internal T? GetTypedValue(long rowIndex) => _columnContainer[rowIndex]; + + protected override object GetValue(long rowIndex) => GetTypedValue(rowIndex); + + protected override void SetValue(long rowIndex, object value) + { + if (value == null || value.GetType() == typeof(T)) + { + _columnContainer[rowIndex] = (T?)value; + } + else + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, DataType), nameof(value)); + } + } + + public new T? this[long rowIndex] + { + get => GetTypedValue(rowIndex); + set + { + if (value == null || value.GetType() == typeof(T)) + { + _columnContainer[rowIndex] = value; + } + else + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, DataType), nameof(value)); + } + } + } + + public override double Median() + { + // Not the most efficient implementation. Using a selection algorithm here would be O(n) instead of O(nLogn) + if (Length == 0) + return 0; + PrimitiveDataFrameColumn sortIndices = GetAscendingSortIndices(); + long middle = sortIndices.Length / 2; + double middleValue = (double)Convert.ChangeType(this[sortIndices[middle].Value].Value, typeof(double)); + if (Length % 2 == 0) + { + double otherMiddleValue = (double)Convert.ChangeType(this[sortIndices[middle - 1].Value].Value, typeof(double)); + return (middleValue + otherMiddleValue) / 2; + } + else + { + return middleValue; + } + } + + public override double Mean() + { + if (Length == 0) + return 0; + return (double)Convert.ChangeType((T)Sum(), typeof(double)) / Length; + } + + protected internal override void Resize(long length) + { + _columnContainer.Resize(length); + Length = _columnContainer.Length; + } + + public void Append(T? value) + { + _columnContainer.Append(value); + Length++; + } + + public void AppendMany(T? value, long count) + { + _columnContainer.AppendMany(value, count); + Length += count; + } + + public override long NullCount + { + get + { + Debug.Assert(_columnContainer.NullCount >= 0); + return _columnContainer.NullCount; + } + } + + public bool IsValid(long index) => _columnContainer.IsValid(index); + + public IEnumerator GetEnumerator() => _columnContainer.GetEnumerator(); + + protected override IEnumerator GetEnumeratorCore() => GetEnumerator(); + + public override bool IsNumericColumn() + { + bool ret = true; + if (typeof(T) == typeof(char) || typeof(T) == typeof(bool)) + ret = false; + return ret; + } + + /// + /// Returns a new column with nulls replaced by value + /// + /// + /// Indicates if the operation should be performed in place + public PrimitiveDataFrameColumn FillNulls(T value, bool inPlace = false) + { + PrimitiveDataFrameColumn column = inPlace ? this : Clone(); + column.ApplyElementwise((T? columnValue, long index) => + { + if (columnValue.HasValue == false) + return value; + else + return columnValue.Value; + }); + return column; + } + + protected override DataFrameColumn FillNullsImplementation(object value, bool inPlace) + { + T convertedValue = (T)Convert.ChangeType(value, typeof(T)); + return FillNulls(convertedValue, inPlace); + } + + public override DataFrame ValueCounts() + { + Dictionary> groupedValues = GroupColumnValues(); + PrimitiveDataFrameColumn keys = new PrimitiveDataFrameColumn("Values"); + PrimitiveDataFrameColumn counts = new PrimitiveDataFrameColumn("Counts"); + foreach (KeyValuePair> keyValuePair in groupedValues) + { + keys.Append(keyValuePair.Key); + counts.Append(keyValuePair.Value.Count); + } + return new DataFrame(new List { keys, counts }); + } + + /// + public override bool HasDescription() => IsNumericColumn(); + + /// + /// Returns a preview of the column contents as a formatted string. + /// + public override string ToString() + { + return $"{Name}: {_columnContainer.ToString()}"; + } + + /// + /// Returns a clone of this column + /// + /// A column who values are used as indices + /// + /// + /// + public new PrimitiveDataFrameColumn Clone(DataFrameColumn mapIndices, bool invertMapIndices, long numberOfNullsToAppend) + { + PrimitiveDataFrameColumn clone; + if (!(mapIndices is null)) + { + Type dataType = mapIndices.DataType; + if (dataType != typeof(long) && dataType != typeof(int) && dataType != typeof(bool)) + throw new ArgumentException(String.Format(Strings.MultipleMismatchedValueType, typeof(long), typeof(int), typeof(bool)), nameof(mapIndices)); + if (dataType == typeof(long)) + clone = Clone(mapIndices as PrimitiveDataFrameColumn, invertMapIndices); + else if (dataType == typeof(int)) + clone = Clone(mapIndices as PrimitiveDataFrameColumn, invertMapIndices); + else + clone = Clone(mapIndices as PrimitiveDataFrameColumn); + } + else + { + clone = Clone(); + } + Debug.Assert(!ReferenceEquals(clone, null)); + clone.AppendMany(null, numberOfNullsToAppend); + return clone; + } + + /// + protected override DataFrameColumn CloneImplementation(DataFrameColumn mapIndices, bool invertMapIndices, long numberOfNullsToAppend) + { + return Clone(mapIndices, invertMapIndices, numberOfNullsToAppend); + } + + private PrimitiveDataFrameColumn Clone(PrimitiveDataFrameColumn boolColumn) + { + if (boolColumn.Length > Length) + throw new ArgumentException(Strings.MapIndicesExceedsColumnLenth, nameof(boolColumn)); + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name); + for (long i = 0; i < boolColumn.Length; i++) + { + bool? value = boolColumn[i]; + if (value.HasValue && value.Value == true) + ret.Append(this[i]); + } + return ret; + } + + private PrimitiveDataFrameColumn CloneImplementation(PrimitiveDataFrameColumn mapIndices, bool invertMapIndices = false) + where U : unmanaged + { + if (!mapIndices.IsNumericColumn()) + throw new ArgumentException(String.Format(Strings.MismatchedValueType, Strings.NumericColumnType), nameof(mapIndices)); + + PrimitiveColumnContainer retContainer; + if (mapIndices.DataType == typeof(long)) + { + retContainer = _columnContainer.Clone(mapIndices._columnContainer, typeof(long), invertMapIndices); + } + else if (mapIndices.DataType == typeof(int)) + { + retContainer = _columnContainer.Clone(mapIndices._columnContainer, typeof(int), invertMapIndices); + } + else + throw new NotImplementedException(); + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name, retContainer); + return ret; + } + + public PrimitiveDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices = null, bool invertMapIndices = false) + { + if (mapIndices is null) + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.Clone(); + return new PrimitiveDataFrameColumn(Name, newColumnContainer); + } + else + { + return CloneImplementation(mapIndices, invertMapIndices); + } + } + + public PrimitiveDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices, bool invertMapIndices = false) + { + return CloneImplementation(mapIndices, invertMapIndices); + } + + public PrimitiveDataFrameColumn Clone(IEnumerable mapIndices) + { + IEnumerator rows = mapIndices.GetEnumerator(); + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name); + ret._columnContainer._modifyNullCountWhileIndexing = false; + long numberOfRows = 0; + while (rows.MoveNext() && numberOfRows < Length) + { + numberOfRows++; + long curRow = rows.Current; + T? value = _columnContainer[curRow]; + ret[curRow] = value; + if (!value.HasValue) + ret._columnContainer.NullCount++; + } + ret._columnContainer._modifyNullCountWhileIndexing = true; + return ret; + } + + internal BooleanDataFrameColumn CloneAsBooleanColumn() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsBoolContainer(); + return new BooleanDataFrameColumn(Name, newColumnContainer); + } + + internal ByteDataFrameColumn CloneAsByteColumn() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsByteContainer(); + return new ByteDataFrameColumn(Name, newColumnContainer); + } + + internal SByteDataFrameColumn CloneAsSByteColumn() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsSByteContainer(); + return new SByteDataFrameColumn(Name, newColumnContainer); + } + + internal DoubleDataFrameColumn CloneAsDoubleColumn() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsDoubleContainer(); + return new DoubleDataFrameColumn(Name, newColumnContainer); + } + + internal DecimalDataFrameColumn CloneAsDecimalColumn() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsDecimalContainer(); + return new DecimalDataFrameColumn(Name, newColumnContainer); + } + + internal Int16DataFrameColumn CloneAsInt16Column() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsShortContainer(); + return new Int16DataFrameColumn(Name, newColumnContainer); + } + + + internal UInt16DataFrameColumn CloneAsUInt16Column() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsUShortContainer(); + return new UInt16DataFrameColumn(Name, newColumnContainer); + } + + internal Int32DataFrameColumn CloneAsInt32Column() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsIntContainer(); + return new Int32DataFrameColumn(Name, newColumnContainer); + } + + internal UInt32DataFrameColumn CloneAsUInt32Column() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsUIntContainer(); + return new UInt32DataFrameColumn(Name, newColumnContainer); + } + + internal Int64DataFrameColumn CloneAsInt64Column() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsLongContainer(); + return new Int64DataFrameColumn(Name, newColumnContainer); + } + + internal UInt64DataFrameColumn CloneAsUInt64Column() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsULongContainer(); + return new UInt64DataFrameColumn(Name, newColumnContainer); + } + + internal SingleDataFrameColumn CloneAsSingleColumn() + { + PrimitiveColumnContainer newColumnContainer = _columnContainer.CloneAsFloatContainer(); + return new SingleDataFrameColumn(Name, newColumnContainer); + } + + /// + public override GroupBy GroupBy(int columnIndex, DataFrame parent) + { + Dictionary> dictionary = GroupColumnValues(); + return new GroupBy(parent, columnIndex, dictionary); + } + + public override Dictionary> GroupColumnValues() + { + if (typeof(TKey) == typeof(T)) + { + Dictionary> multimap = new Dictionary>(EqualityComparer.Default); + for (int b = 0; b < _columnContainer.Buffers.Count; b++) + { + ReadOnlyDataFrameBuffer buffer = _columnContainer.Buffers[b]; + ReadOnlySpan readOnlySpan = buffer.ReadOnlySpan; + long previousLength = b * ReadOnlyDataFrameBuffer.MaxCapacity; + for (int i = 0; i < readOnlySpan.Length; i++) + { + long currentLength = i + previousLength; + bool containsKey = multimap.TryGetValue(readOnlySpan[i], out ICollection values); + if (containsKey) + { + values.Add(currentLength); + } + else + { + multimap.Add(readOnlySpan[i], new List() { currentLength }); + } + } + } + return multimap as Dictionary>; + } + else + { + throw new NotImplementedException(nameof(TKey)); + } + } + + public void ApplyElementwise(Func func) => _columnContainer.ApplyElementwise(func); + + /// + /// Applies a function to all the values + /// + /// The new column's type + /// The function to apply + /// A new PrimitiveDataFrameColumn containing the new values + public PrimitiveDataFrameColumn Apply(Func func) where TResult : unmanaged + { + var resultColumn = new PrimitiveDataFrameColumn("Result", Length); + _columnContainer.Apply(func, resultColumn._columnContainer); + return resultColumn; + } + + /// + /// Clamps values beyond the specified thresholds + /// + /// Minimum value. All values below this threshold will be set to it + /// Maximum value. All values above this threshold will be set to it + /// Indicates if the operation should be performed in place + public PrimitiveDataFrameColumn Clamp(T min, T max, bool inPlace = false) + { + PrimitiveDataFrameColumn ret = inPlace ? this : Clone(); + + Comparer comparer = Comparer.Default; + for (long i = 0; i < ret.Length; i++) + { + T? value = ret[i]; + if (value == null) + continue; + + if (comparer.Compare(value.Value, min) < 0) + ret[i] = min; + + if (comparer.Compare(value.Value, max) > 0) + ret[i] = max; + } + return ret; + } + + protected override DataFrameColumn ClampImplementation(U min, U max, bool inPlace) + { + object convertedLower = Convert.ChangeType(min, typeof(T)); + if (typeof(T) == typeof(U) || convertedLower != null) + return Clamp((T)convertedLower, (T)Convert.ChangeType(max, typeof(T)), inPlace); + else + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(U)); + } + + /// + /// Returns a new column filtered by the lower and upper bounds + /// + /// The minimum value in the resulting column + /// The maximum value in the resulting column + public PrimitiveDataFrameColumn Filter(T min, T max) + { + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name); + Comparer comparer = Comparer.Default; + for (long i = 0; i < Length; i++) + { + T? value = this[i]; + if (value == null) + continue; + + if (comparer.Compare(value.Value, min) >= 0 && comparer.Compare(value.Value, max) <= 0) + ret.Append(value); + } + return ret; + } + + protected override DataFrameColumn FilterImplementation(U min, U max) + { + object convertedLower = Convert.ChangeType(min, typeof(T)); + if (typeof(T) == typeof(U) || convertedLower != null) + return Filter((T)convertedLower, (T)Convert.ChangeType(max, typeof(T))); + else + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(T)), nameof(U)); + } + + public override DataFrameColumn Description() + { + float? max; + float? min; + float? mean; + try + { + max = (float)Convert.ChangeType(Max(), typeof(float)); + } + catch (Exception) + { + max = null; + } + try + { + min = (float)Convert.ChangeType(Min(), typeof(float)); + } + catch (Exception) + { + min = null; + } + try + { + mean = (float)Convert.ChangeType(Sum(), typeof(float)) / Length; + } + catch (Exception) + { + mean = null; + } + PrimitiveDataFrameColumn column = new PrimitiveDataFrameColumn(Name); + column.Append(Length - NullCount); + column.Append(max); + column.Append(min); + column.Append(mean); + return column; + } + + protected internal override void AddDataViewColumn(DataViewSchema.Builder builder) + { + builder.AddColumn(Name, GetDataViewType()); + } + + private static DataViewType GetDataViewType() + { + if (typeof(T) == typeof(bool)) + { + return BooleanDataViewType.Instance; + } + else if (typeof(T) == typeof(byte)) + { + return NumberDataViewType.Byte; + } + else if (typeof(T) == typeof(double)) + { + return NumberDataViewType.Double; + } + else if (typeof(T) == typeof(float)) + { + return NumberDataViewType.Single; + } + else if (typeof(T) == typeof(int)) + { + return NumberDataViewType.Int32; + } + else if (typeof(T) == typeof(long)) + { + return NumberDataViewType.Int64; + } + else if (typeof(T) == typeof(sbyte)) + { + return NumberDataViewType.SByte; + } + else if (typeof(T) == typeof(short)) + { + return NumberDataViewType.Int16; + } + else if (typeof(T) == typeof(uint)) + { + return NumberDataViewType.UInt32; + } + else if (typeof(T) == typeof(ulong)) + { + return NumberDataViewType.UInt64; + } + else if (typeof(T) == typeof(ushort)) + { + return NumberDataViewType.UInt16; + } + // The following 2 implementations are not ideal, but IDataView doesn't support + // these types + else if (typeof(T) == typeof(char)) + { + return NumberDataViewType.UInt16; + } + else if (typeof(T) == typeof(decimal)) + { + return NumberDataViewType.Double; + } + + throw new NotSupportedException(); + } + + protected internal override Delegate GetDataViewGetter(DataViewRowCursor cursor) + { + // special cases for types that have NA values + if (typeof(T) == typeof(float)) + { + return CreateSingleValueGetterDelegate(cursor, (PrimitiveDataFrameColumn)(object)this); + } + else if (typeof(T) == typeof(double)) + { + return CreateDoubleValueGetterDelegate(cursor, (PrimitiveDataFrameColumn)(object)this); + } + // special cases for types not supported + else if (typeof(T) == typeof(char)) + { + return CreateCharValueGetterDelegate(cursor, (PrimitiveDataFrameColumn)(object)this); + } + else if (typeof(T) == typeof(decimal)) + { + return CreateDecimalValueGetterDelegate(cursor, (PrimitiveDataFrameColumn)(object)this); + } + return CreateValueGetterDelegate(cursor); + } + + private ValueGetter CreateValueGetterDelegate(DataViewRowCursor cursor) => + (ref T value) => value = this[cursor.Position].GetValueOrDefault(); + + private static ValueGetter CreateSingleValueGetterDelegate(DataViewRowCursor cursor, PrimitiveDataFrameColumn column) => + (ref float value) => value = column[cursor.Position] ?? float.NaN; + + private static ValueGetter CreateDoubleValueGetterDelegate(DataViewRowCursor cursor, PrimitiveDataFrameColumn column) => + (ref double value) => value = column[cursor.Position] ?? double.NaN; + + private static ValueGetter CreateCharValueGetterDelegate(DataViewRowCursor cursor, PrimitiveDataFrameColumn column) => + (ref ushort value) => value = column[cursor.Position].GetValueOrDefault(); + + private static ValueGetter CreateDecimalValueGetterDelegate(DataViewRowCursor cursor, PrimitiveDataFrameColumn column) => + (ref double value) => value = (double?)column[cursor.Position] ?? double.NaN; + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs new file mode 100644 index 0000000000..c4129026a1 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs @@ -0,0 +1,6770 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumnArithmetic.tt. Do not modify directly + +using System; + +namespace Microsoft.Data.Analysis +{ + internal interface IPrimitiveDataFrameColumnArithmetic + where T : struct + { + void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Add(PrimitiveColumnContainer column, T scalar); + void Add(T scalar, PrimitiveColumnContainer column); + void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Subtract(PrimitiveColumnContainer column, T scalar); + void Subtract(T scalar, PrimitiveColumnContainer column); + void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Multiply(PrimitiveColumnContainer column, T scalar); + void Multiply(T scalar, PrimitiveColumnContainer column); + void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Divide(PrimitiveColumnContainer column, T scalar); + void Divide(T scalar, PrimitiveColumnContainer column); + void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Modulo(PrimitiveColumnContainer column, T scalar); + void Modulo(T scalar, PrimitiveColumnContainer column); + void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void And(PrimitiveColumnContainer column, T scalar); + void And(T scalar, PrimitiveColumnContainer column); + void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Or(PrimitiveColumnContainer column, T scalar); + void Or(T scalar, PrimitiveColumnContainer column); + void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right); + void Xor(PrimitiveColumnContainer column, T scalar); + void Xor(T scalar, PrimitiveColumnContainer column); + void LeftShift(PrimitiveColumnContainer column, int value); + void RightShift(PrimitiveColumnContainer column, int value); + void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret); + void ElementwiseEquals(PrimitiveColumnContainer column, T scalar, PrimitiveColumnContainer ret); + void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret); + void ElementwiseNotEquals(PrimitiveColumnContainer column, T scalar, PrimitiveColumnContainer ret); + void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret); + void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, T scalar, PrimitiveColumnContainer ret); + void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret); + void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, T scalar, PrimitiveColumnContainer ret); + void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret); + void ElementwiseGreaterThan(PrimitiveColumnContainer column, T scalar, PrimitiveColumnContainer ret); + void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret); + void ElementwiseLessThan(PrimitiveColumnContainer column, T scalar, PrimitiveColumnContainer ret); + } + + internal static class PrimitiveDataFrameColumnArithmetic + where T : struct + { + public static IPrimitiveDataFrameColumnArithmetic Instance { get; } = PrimitiveDataFrameColumnArithmetic.GetArithmetic(); + } + + internal static class PrimitiveDataFrameColumnArithmetic + { + public static IPrimitiveDataFrameColumnArithmetic GetArithmetic() + where T : struct + { + if (typeof(T) == typeof(bool)) + { + return (IPrimitiveDataFrameColumnArithmetic)new BoolArithmetic(); + } + else if (typeof(T) == typeof(byte)) + { + return (IPrimitiveDataFrameColumnArithmetic)new ByteArithmetic(); + } + else if (typeof(T) == typeof(char)) + { + return (IPrimitiveDataFrameColumnArithmetic)new CharArithmetic(); + } + else if (typeof(T) == typeof(decimal)) + { + return (IPrimitiveDataFrameColumnArithmetic)new DecimalArithmetic(); + } + else if (typeof(T) == typeof(double)) + { + return (IPrimitiveDataFrameColumnArithmetic)new DoubleArithmetic(); + } + else if (typeof(T) == typeof(float)) + { + return (IPrimitiveDataFrameColumnArithmetic)new FloatArithmetic(); + } + else if (typeof(T) == typeof(int)) + { + return (IPrimitiveDataFrameColumnArithmetic)new IntArithmetic(); + } + else if (typeof(T) == typeof(long)) + { + return (IPrimitiveDataFrameColumnArithmetic)new LongArithmetic(); + } + else if (typeof(T) == typeof(sbyte)) + { + return (IPrimitiveDataFrameColumnArithmetic)new SByteArithmetic(); + } + else if (typeof(T) == typeof(short)) + { + return (IPrimitiveDataFrameColumnArithmetic)new ShortArithmetic(); + } + else if (typeof(T) == typeof(uint)) + { + return (IPrimitiveDataFrameColumnArithmetic)new UIntArithmetic(); + } + else if (typeof(T) == typeof(ulong)) + { + return (IPrimitiveDataFrameColumnArithmetic)new ULongArithmetic(); + } + else if (typeof(T) == typeof(ushort)) + { + return (IPrimitiveDataFrameColumnArithmetic)new UShortArithmetic(); + } + throw new NotSupportedException(); + } + } + + internal class BoolArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Add(PrimitiveColumnContainer column, bool scalar) + { + throw new NotSupportedException(); + } + + public void Add(bool scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Subtract(PrimitiveColumnContainer column, bool scalar) + { + throw new NotSupportedException(); + } + + public void Subtract(bool scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Multiply(PrimitiveColumnContainer column, bool scalar) + { + throw new NotSupportedException(); + } + + public void Multiply(bool scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Divide(PrimitiveColumnContainer column, bool scalar) + { + throw new NotSupportedException(); + } + + public void Divide(bool scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Modulo(PrimitiveColumnContainer column, bool scalar) + { + throw new NotSupportedException(); + } + + public void Modulo(bool scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, bool scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(span[i] & scalar); + } + } + } + + public void And(bool scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, bool scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(span[i] | scalar); + } + } + } + + public void Or(bool scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, bool scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(span[i] ^ scalar); + } + } + } + + public void Xor(bool scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (bool)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) + { + throw new NotSupportedException(); + } + } + internal class ByteArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] + scalar); + } + } + } + + public void Add(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] - scalar); + } + } + } + + public void Subtract(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] * scalar); + } + } + } + + public void Multiply(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] / scalar); + } + } + } + + public void Divide(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] % scalar); + } + } + } + + public void Modulo(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] & scalar); + } + } + } + + public void And(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] | scalar); + } + } + } + + public void Or(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, byte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] ^ scalar); + } + } + } + + public void Xor(byte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (byte)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class CharArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] + scalar); + } + } + } + + public void Add(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] - scalar); + } + } + } + + public void Subtract(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] * scalar); + } + } + } + + public void Multiply(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] / scalar); + } + } + } + + public void Divide(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] % scalar); + } + } + } + + public void Modulo(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] & scalar); + } + } + } + + public void And(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] | scalar); + } + } + } + + public void Or(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, char scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] ^ scalar); + } + } + } + + public void Xor(char scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (char)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class DecimalArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, decimal scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] + scalar); + } + } + } + + public void Add(decimal scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, decimal scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] - scalar); + } + } + } + + public void Subtract(decimal scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, decimal scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] * scalar); + } + } + } + + public void Multiply(decimal scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, decimal scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] / scalar); + } + } + } + + public void Divide(decimal scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, decimal scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(span[i] % scalar); + } + } + } + + public void Modulo(decimal scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (decimal)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void And(PrimitiveColumnContainer column, decimal scalar) + { + throw new NotSupportedException(); + } + + public void And(decimal scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Or(PrimitiveColumnContainer column, decimal scalar) + { + throw new NotSupportedException(); + } + + public void Or(decimal scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Xor(PrimitiveColumnContainer column, decimal scalar) + { + throw new NotSupportedException(); + } + + public void Xor(decimal scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class DoubleArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, double scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] + scalar); + } + } + } + + public void Add(double scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, double scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] - scalar); + } + } + } + + public void Subtract(double scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, double scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] * scalar); + } + } + } + + public void Multiply(double scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, double scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] / scalar); + } + } + } + + public void Divide(double scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, double scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(span[i] % scalar); + } + } + } + + public void Modulo(double scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (double)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void And(PrimitiveColumnContainer column, double scalar) + { + throw new NotSupportedException(); + } + + public void And(double scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Or(PrimitiveColumnContainer column, double scalar) + { + throw new NotSupportedException(); + } + + public void Or(double scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Xor(PrimitiveColumnContainer column, double scalar) + { + throw new NotSupportedException(); + } + + public void Xor(double scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class FloatArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, float scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] + scalar); + } + } + } + + public void Add(float scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, float scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] - scalar); + } + } + } + + public void Subtract(float scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, float scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] * scalar); + } + } + } + + public void Multiply(float scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, float scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] / scalar); + } + } + } + + public void Divide(float scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, float scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(span[i] % scalar); + } + } + } + + public void Modulo(float scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (float)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void And(PrimitiveColumnContainer column, float scalar) + { + throw new NotSupportedException(); + } + + public void And(float scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Or(PrimitiveColumnContainer column, float scalar) + { + throw new NotSupportedException(); + } + + public void Or(float scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + throw new NotSupportedException(); + } + public void Xor(PrimitiveColumnContainer column, float scalar) + { + throw new NotSupportedException(); + } + + public void Xor(float scalar, PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + throw new NotSupportedException(); + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class IntArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] + scalar); + } + } + } + + public void Add(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] - scalar); + } + } + } + + public void Subtract(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] * scalar); + } + } + } + + public void Multiply(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] / scalar); + } + } + } + + public void Divide(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] % scalar); + } + } + } + + public void Modulo(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] & scalar); + } + } + } + + public void And(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] | scalar); + } + } + } + + public void Or(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, int scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] ^ scalar); + } + } + } + + public void Xor(int scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (int)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class LongArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] + scalar); + } + } + } + + public void Add(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] - scalar); + } + } + } + + public void Subtract(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] * scalar); + } + } + } + + public void Multiply(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] / scalar); + } + } + } + + public void Divide(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] % scalar); + } + } + } + + public void Modulo(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] & scalar); + } + } + } + + public void And(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] | scalar); + } + } + } + + public void Or(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, long scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] ^ scalar); + } + } + } + + public void Xor(long scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (long)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class SByteArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] + scalar); + } + } + } + + public void Add(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] - scalar); + } + } + } + + public void Subtract(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] * scalar); + } + } + } + + public void Multiply(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] / scalar); + } + } + } + + public void Divide(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] % scalar); + } + } + } + + public void Modulo(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] & scalar); + } + } + } + + public void And(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] | scalar); + } + } + } + + public void Or(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, sbyte scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] ^ scalar); + } + } + } + + public void Xor(sbyte scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (sbyte)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class ShortArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] + scalar); + } + } + } + + public void Add(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] - scalar); + } + } + } + + public void Subtract(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] * scalar); + } + } + } + + public void Multiply(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] / scalar); + } + } + } + + public void Divide(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] % scalar); + } + } + } + + public void Modulo(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] & scalar); + } + } + } + + public void And(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] | scalar); + } + } + } + + public void Or(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, short scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] ^ scalar); + } + } + } + + public void Xor(short scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (short)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class UIntArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] + scalar); + } + } + } + + public void Add(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] - scalar); + } + } + } + + public void Subtract(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] * scalar); + } + } + } + + public void Multiply(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] / scalar); + } + } + } + + public void Divide(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] % scalar); + } + } + } + + public void Modulo(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] & scalar); + } + } + } + + public void And(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] | scalar); + } + } + } + + public void Or(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, uint scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] ^ scalar); + } + } + } + + public void Xor(uint scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (uint)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class ULongArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] + scalar); + } + } + } + + public void Add(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] - scalar); + } + } + } + + public void Subtract(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] * scalar); + } + } + } + + public void Multiply(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] / scalar); + } + } + } + + public void Divide(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] % scalar); + } + } + } + + public void Modulo(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] & scalar); + } + } + } + + public void And(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] | scalar); + } + } + } + + public void Or(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, ulong scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] ^ scalar); + } + } + } + + public void Xor(ulong scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ulong)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + internal class UShortArithmetic : IPrimitiveDataFrameColumnArithmetic + { + public void Add(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] + otherSpan[i]); + } + } + } + public void Add(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] + scalar); + } + } + } + + public void Add(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar + span[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] - otherSpan[i]); + } + } + } + public void Subtract(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] - scalar); + } + } + } + + public void Subtract(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar - span[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] * otherSpan[i]); + } + } + } + public void Multiply(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] * scalar); + } + } + } + + public void Multiply(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar * span[i]); + } + } + } + public void Divide(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] / otherSpan[i]); + } + } + } + public void Divide(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] / scalar); + } + } + } + + public void Divide(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar / span[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] % otherSpan[i]); + } + } + } + public void Modulo(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] % scalar); + } + } + } + + public void Modulo(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar % span[i]); + } + } + } + public void And(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] & otherSpan[i]); + } + } + } + public void And(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] & scalar); + } + } + } + + public void And(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar & span[i]); + } + } + } + public void Or(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] | otherSpan[i]); + } + } + } + public void Or(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] | scalar); + } + } + } + + public void Or(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar | span[i]); + } + } + } + public void Xor(PrimitiveColumnContainer left, PrimitiveColumnContainer right) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] ^ otherSpan[i]); + } + } + } + public void Xor(PrimitiveColumnContainer column, ushort scalar) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] ^ scalar); + } + } + } + + public void Xor(ushort scalar, PrimitiveColumnContainer column) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(scalar ^ span[i]); + } + } + } + public void LeftShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] << value); + } + } + } + public void RightShift(PrimitiveColumnContainer column, int value) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + span[i] = (ushort)(span[i] >> value); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == otherSpan[i]); + } + } + } + public void ElementwiseEquals(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] == scalar); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != otherSpan[i]); + } + } + } + public void ElementwiseNotEquals(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] != scalar); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= otherSpan[i]); + } + } + } + public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] >= scalar); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= otherSpan[i]); + } + } + } + public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] <= scalar); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > otherSpan[i]); + } + } + } + public void ElementwiseGreaterThan(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] > scalar); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < left.Buffers.Count; b++) + { + var buffer = left.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + left.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + var otherSpan = right.Buffers[b].ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < otherSpan[i]); + } + } + } + public void ElementwiseLessThan(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) + { + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + column.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; + for (int i = 0; i < span.Length; i++) + { + ret[i] = (span[i] < scalar); + } + } + } + } + + + + +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt new file mode 100644 index 0000000000..7af9f7b040 --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt @@ -0,0 +1,119 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveDataFrameColumnArithmetic.tt. Do not modify directly + +using System; + +namespace Microsoft.Data.Analysis +{ + internal interface IPrimitiveDataFrameColumnArithmetic + where T : struct + { +<# foreach (MethodConfiguration method in methodConfiguration) { #> + <#= method.GetMethodSignature("PrimitiveColumnContainer", "T")#>; +<# if (method.MethodType == MethodType.BinaryScalar) { #> + <#= method.GetInvertedMethodSignatureForBinaryScalarsOps("PrimitiveColumnContainer", "T")#>; +<# } #> +<# } #> + } + + internal static class PrimitiveDataFrameColumnArithmetic + where T : struct + { + public static IPrimitiveDataFrameColumnArithmetic Instance { get; } = PrimitiveDataFrameColumnArithmetic.GetArithmetic(); + } + + internal static class PrimitiveDataFrameColumnArithmetic + { + public static IPrimitiveDataFrameColumnArithmetic GetArithmetic() + where T : struct + { +<# foreach (TypeConfiguration type in typeConfiguration) { #> + <#=GenerateIfStatementHeader(type)#> + { + return (IPrimitiveDataFrameColumnArithmetic)new <#=type.ClassPrefix#>Arithmetic(); + } +<# } #> + throw new NotSupportedException(); + } + } + +<# foreach (TypeConfiguration type in typeConfiguration) { #> + internal class <#=type.ClassPrefix#>Arithmetic : IPrimitiveDataFrameColumnArithmetic<<#=type.TypeName#>> + { +<# foreach (MethodConfiguration method in methodConfiguration) { #> + public <#= method.GetMethodSignature("PrimitiveColumnContainer", type.TypeName) #> + { +<# if ((method.IsNumeric && !type.SupportsNumeric) || (method.IsBitwise && !type.SupportsBitwise) || (type.UnsupportedMethods.Contains(method.MethodName))) { #> + throw new NotSupportedException(); +<# } else if (method.Operator != null) { #> + for (int b = 0 ; b < <#= method.Op1Name #>.Buffers.Count; b++) + { + var buffer = <#= method.Op1Name #>.Buffers[b]; + var mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(buffer); + <#= method.Op1Name #>.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; +<# if (method.MethodType == MethodType.Binary || method.MethodType == MethodType.Comparison) { #> + var otherSpan = <#=method.Op2Name#>.Buffers[b].ReadOnlySpan; +<# } #> + for (int i = 0; i < span.Length; i++) + { +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.BinaryInt) { #> + span[i] = (<#=type.TypeName#>)(span[i] <#= method.Operator #> <#= method.Op2Name #>); +<# } else if (method.MethodType == MethodType.Binary) { #> + span[i] = (<#=type.TypeName#>)(span[i] <#= method.Operator #> otherSpan[i]); +<# } else if (method.MethodType == MethodType.Comparison) { #> + ret[i] = (span[i] <#= method.Operator #> otherSpan[i]); +<# } else if (method.MethodType == MethodType.ComparisonScalar) { #> + ret[i] = (span[i] <#= method.Operator #> <#= method.Op2Name #>); +<# } else {#> + throw new NotImplementedException(); +<# } #> + } + } +<# } #> + } +<# if (method.MethodType == MethodType.BinaryScalar) { #> + public <#= method.GetInvertedMethodSignatureForBinaryScalarsOps("PrimitiveColumnContainer", type.TypeName) #> + { +<# if ((method.IsNumeric && !type.SupportsNumeric) || (method.IsBitwise && !type.SupportsBitwise) || (type.UnsupportedMethods.Contains(method.MethodName))) { #> + throw new NotSupportedException(); +<# } else if (method.Operator != null) { #> + for (int b = 0 ; b < <#= method.Op1Name #>.Buffers.Count; b++) + { + var buffer = <#= method.Op1Name #>.Buffers[b]; + var mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(buffer); + <#= method.Op1Name #>.Buffers[b] = mutableBuffer; + var span = mutableBuffer.Span; +<# if (method.MethodType == MethodType.Binary || method.MethodType == MethodType.Comparison) { #> + var otherSpan = <#=method.Op2Name#>.Buffers[b].ReadOnlySpan; +<# } #> + for (int i = 0; i < span.Length; i++) + { +<# if (method.MethodType == MethodType.BinaryScalar || method.MethodType == MethodType.BinaryInt) { #> + span[i] = (<#=type.TypeName#>)(<#= method.Op2Name #> <#= method.Operator #> span[i]); +<# } #> + } + } +<# } #> + } +<# } #> +<# } #> + } +<# } #> + + + + +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.cs new file mode 100644 index 0000000000..987209fa1a --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.cs @@ -0,0 +1,5359 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveColumnComputations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + internal interface IPrimitiveColumnComputation + where T : struct + { + void Abs(PrimitiveColumnContainer column); + void All(PrimitiveColumnContainer column, out bool ret); + void Any(PrimitiveColumnContainer column, out bool ret); + void CumulativeMax(PrimitiveColumnContainer column); + void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows); + void CumulativeMin(PrimitiveColumnContainer column); + void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows); + void CumulativeProduct(PrimitiveColumnContainer column); + void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows); + void CumulativeSum(PrimitiveColumnContainer column); + void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows); + void Max(PrimitiveColumnContainer column, out T ret); + void Max(PrimitiveColumnContainer column, IEnumerable rows, out T ret); + void Min(PrimitiveColumnContainer column, out T ret); + void Min(PrimitiveColumnContainer column, IEnumerable rows, out T ret); + void Product(PrimitiveColumnContainer column, out T ret); + void Product(PrimitiveColumnContainer column, IEnumerable rows, out T ret); + void Sum(PrimitiveColumnContainer column, out T ret); + void Sum(PrimitiveColumnContainer column, IEnumerable rows, out T ret); + void Round(PrimitiveColumnContainer column); + } + + internal static class PrimitiveColumnComputation + where T : struct + { + public static IPrimitiveColumnComputation Instance { get; } = PrimitiveColumnComputation.GetComputation(); + } + + internal static class PrimitiveColumnComputation + { + public static IPrimitiveColumnComputation GetComputation() + where T : struct + { + if (typeof(T) == typeof(bool)) + { + return (IPrimitiveColumnComputation)new BoolComputation(); + } + else if (typeof(T) == typeof(byte)) + { + return (IPrimitiveColumnComputation)new ByteComputation(); + } + else if (typeof(T) == typeof(char)) + { + return (IPrimitiveColumnComputation)new CharComputation(); + } + else if (typeof(T) == typeof(decimal)) + { + return (IPrimitiveColumnComputation)new DecimalComputation(); + } + else if (typeof(T) == typeof(double)) + { + return (IPrimitiveColumnComputation)new DoubleComputation(); + } + else if (typeof(T) == typeof(float)) + { + return (IPrimitiveColumnComputation)new FloatComputation(); + } + else if (typeof(T) == typeof(int)) + { + return (IPrimitiveColumnComputation)new IntComputation(); + } + else if (typeof(T) == typeof(long)) + { + return (IPrimitiveColumnComputation)new LongComputation(); + } + else if (typeof(T) == typeof(sbyte)) + { + return (IPrimitiveColumnComputation)new SByteComputation(); + } + else if (typeof(T) == typeof(short)) + { + return (IPrimitiveColumnComputation)new ShortComputation(); + } + else if (typeof(T) == typeof(uint)) + { + return (IPrimitiveColumnComputation)new UIntComputation(); + } + else if (typeof(T) == typeof(ulong)) + { + return (IPrimitiveColumnComputation)new ULongComputation(); + } + else if (typeof(T) == typeof(ushort)) + { + return (IPrimitiveColumnComputation)new UShortComputation(); + } + throw new NotSupportedException(); + } + } + + internal class BoolComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + ret = true; + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + if (span[i] == false) + { + ret = false; + return; + } + } + } + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + ret = false; + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { + if (span[i] == true) + { + ret = true; + return; + } + } + } + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + throw new NotSupportedException(); + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + throw new NotSupportedException(); + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + throw new NotSupportedException(); + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + throw new NotSupportedException(); + } + + public void Max(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out bool ret) + { + throw new NotSupportedException(); + } + + public void Min(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out bool ret) + { + throw new NotSupportedException(); + } + + public void Product(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out bool ret) + { + throw new NotSupportedException(); + } + + public void Sum(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out bool ret) + { + throw new NotSupportedException(); + } + + public void Round(PrimitiveColumnContainer column) + { + throw new NotSupportedException(); + } + + } + internal class ByteComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (byte)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(byte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (byte)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(byte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (byte)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (byte)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(byte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((byte)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (byte)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(byte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((byte)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out byte ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out byte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (byte)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out byte ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out byte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (byte)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out byte ret) + { + ret = (byte)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out byte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((byte)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out byte ret) + { + ret = (byte)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (byte)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out byte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((byte)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (byte)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class CharComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (char)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(char); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (char)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(char); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (char)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (char)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(char); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((char)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (char)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(char); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((char)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out char ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out char ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (char)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out char ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out char ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (char)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out char ret) + { + ret = (char)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out char ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((char)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out char ret) + { + ret = (char)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (char)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out char ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((char)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (char)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class DecimalComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (decimal)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(decimal); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (decimal)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(decimal); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (decimal)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (decimal)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(decimal); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((decimal)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (decimal)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(decimal); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((decimal)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out decimal ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out decimal ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (decimal)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out decimal ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out decimal ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (decimal)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out decimal ret) + { + ret = (decimal)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out decimal ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((decimal)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out decimal ret) + { + ret = (decimal)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (decimal)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out decimal ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((decimal)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (decimal)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class DoubleComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (double)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(double); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (double)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(double); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (double)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (double)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(double); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((double)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (double)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(double); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((double)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out double ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out double ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (double)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out double ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out double ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (double)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out double ret) + { + ret = (double)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out double ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((double)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out double ret) + { + ret = (double)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (double)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out double ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((double)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (double)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class FloatComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (float)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(float); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (float)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(float); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (float)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (float)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(float); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((float)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (float)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(float); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((float)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out float ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out float ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (float)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out float ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out float ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (float)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out float ret) + { + ret = (float)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out float ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((float)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out float ret) + { + ret = (float)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (float)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out float ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((float)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (float)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class IntComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (int)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(int); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (int)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(int); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (int)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (int)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(int); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((int)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (int)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(int); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((int)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out int ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out int ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (int)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out int ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out int ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (int)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out int ret) + { + ret = (int)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out int ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((int)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out int ret) + { + ret = (int)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (int)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out int ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((int)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (int)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class LongComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (long)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(long); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (long)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(long); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (long)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (long)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(long); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((long)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (long)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(long); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((long)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out long ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out long ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (long)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out long ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out long ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (long)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out long ret) + { + ret = (long)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out long ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((long)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out long ret) + { + ret = (long)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (long)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out long ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((long)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (long)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class SByteComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (sbyte)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(sbyte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (sbyte)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(sbyte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (sbyte)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (sbyte)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(sbyte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((sbyte)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (sbyte)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(sbyte); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((sbyte)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out sbyte ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out sbyte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (sbyte)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out sbyte ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out sbyte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (sbyte)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out sbyte ret) + { + ret = (sbyte)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out sbyte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((sbyte)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out sbyte ret) + { + ret = (sbyte)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (sbyte)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out sbyte ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((sbyte)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (sbyte)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class ShortComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (short)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(short); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (short)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(short); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (short)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (short)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(short); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((short)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (short)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(short); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((short)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out short ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out short ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (short)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out short ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out short ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (short)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out short ret) + { + ret = (short)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out short ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((short)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out short ret) + { + ret = (short)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (short)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out short ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((short)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (short)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class UIntComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (uint)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(uint); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (uint)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(uint); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (uint)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (uint)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(uint); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((uint)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (uint)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(uint); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((uint)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out uint ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out uint ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (uint)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out uint ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out uint ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (uint)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out uint ret) + { + ret = (uint)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out uint ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((uint)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out uint ret) + { + ret = (uint)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (uint)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out uint ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((uint)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (uint)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class ULongComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (ulong)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ulong); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ulong)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ulong); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ulong)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (ulong)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ulong); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ulong)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (ulong)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ulong); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ulong)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out ulong ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out ulong ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ulong)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out ulong ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out ulong ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ulong)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out ulong ret) + { + ret = (ulong)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out ulong ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ulong)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out ulong ret) + { + ret = (ulong)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ulong)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out ulong ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ulong)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (ulong)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } + internal class UShortComputation : IPrimitiveColumnComputation + { + public void Abs(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (ushort)(Math.Abs((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + public void All(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void Any(PrimitiveColumnContainer column, out bool ret) + { + throw new NotSupportedException(); + } + + public void CumulativeMax(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMax(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ushort); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ushort)Math.Max(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column) + { + var ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeMin(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ushort); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ushort)Math.Min(span[(int)row], ret); + span[(int)row] = ret; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column) + { + var ret = (ushort)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeProduct(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ushort); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ushort)((span[(int)row]) * ret)); + span[(int)row] = ret; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column) + { + var ret = (ushort)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; + } + column.Buffers[b] = mutableBuffer; + } + } + + public void CumulativeSum(PrimitiveColumnContainer column, IEnumerable rows) + { + var ret = default(ushort); + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ushort)((span[(int)row]) + ret)); + span[(int)row] = ret; + } + } + + public void Max(PrimitiveColumnContainer column, out ushort ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(Math.Max(readOnlySpan[i], ret)); + } + } + } + + public void Max(PrimitiveColumnContainer column, IEnumerable rows, out ushort ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ushort)(Math.Max(readOnlySpan[(int)row], ret)); + } + } + + public void Min(PrimitiveColumnContainer column, out ushort ret) + { + ret = column.Buffers[0].ReadOnlySpan[0]; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(Math.Min(readOnlySpan[i], ret)); + } + } + } + + public void Min(PrimitiveColumnContainer column, IEnumerable rows, out ushort ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = (ushort)(Math.Min(readOnlySpan[(int)row], ret)); + } + } + + public void Product(PrimitiveColumnContainer column, out ushort ret) + { + ret = (ushort)1; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(readOnlySpan[i] * ret); + } + } + } + + public void Product(PrimitiveColumnContainer column, IEnumerable rows, out ushort ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ushort)(readOnlySpan[(int)row] * ret)); + } + } + + public void Sum(PrimitiveColumnContainer column, out ushort ret) + { + ret = (ushort)0; + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { + ret = (ushort)(readOnlySpan[i] + ret); + } + } + } + + public void Sum(PrimitiveColumnContainer column, IEnumerable rows, out ushort ret) + { + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = checked((ushort)(readOnlySpan[(int)row] + ret)); + } + } + + public void Round(PrimitiveColumnContainer column) + { + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (ushort)(Math.Round((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } + } + + } +} diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.tt new file mode 100644 index 0000000000..a2f82a8c2f --- /dev/null +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.tt @@ -0,0 +1,268 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="ColumnArithmeticTemplate.ttinclude" #> + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from PrimitiveColumnComputations.tt. Do not modify directly + +using System; +using System.Collections.Generic; + +namespace Microsoft.Data.Analysis +{ + internal interface IPrimitiveColumnComputation + where T : struct + { +<# foreach (MethodConfiguration compMethod in computationMethodConfiguration) { #> +<# if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false && compMethod.SupportsRowSubsets == true) {#> + void <#=compMethod.MethodName#>(PrimitiveColumnContainer column, IEnumerable rows); +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == false) {#> + void <#=compMethod.MethodName#>(PrimitiveColumnContainer column); +<# } else if (compMethod.MethodType == MethodType.ElementwiseComputation && compMethod.HasReturnValue == true) {#> + void <#=compMethod.MethodName#>(PrimitiveColumnContainer column, out T ret); +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true && compMethod.SupportsRowSubsets == true) { #> + void <#=compMethod.MethodName#>(PrimitiveColumnContainer column, IEnumerable rows, out T ret); +<# } else if (compMethod.MethodType == MethodType.Reduction && compMethod.IsNumeric == true) { #> + void <#=compMethod.MethodName#>(PrimitiveColumnContainer column, out T ret); +<# } else { #> + void <#=compMethod.MethodName#>(PrimitiveColumnContainer column, out bool ret); +<# } #> +<# } #> + } + + internal static class PrimitiveColumnComputation + where T : struct + { + public static IPrimitiveColumnComputation Instance { get; } = PrimitiveColumnComputation.GetComputation(); + } + + internal static class PrimitiveColumnComputation + { + public static IPrimitiveColumnComputation GetComputation() + where T : struct + { +<# foreach (TypeConfiguration type in typeConfiguration) { #> + <#=GenerateIfStatementHeader(type)#> + { + return (IPrimitiveColumnComputation)new <#=type.ClassPrefix#>Computation(); + } +<# } #> + throw new NotSupportedException(); + } + } + +<# foreach (TypeConfiguration type in typeConfiguration) { #> + internal class <#=type.ClassPrefix#>Computation : IPrimitiveColumnComputation<<#=type.TypeName#>> + { +<# foreach (MethodConfiguration method in computationMethodConfiguration) { #> +<# if (method.MethodType == MethodType.ElementwiseComputation && method.HasReturnValue == false && method.SupportsRowSubsets == true) {#> + public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, IEnumerable rows) +<# } else if (method.MethodType == MethodType.ElementwiseComputation && method.HasReturnValue == false) {#> + public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column) +<# } else if (method.MethodType == MethodType.ElementwiseComputation && method.HasReturnValue == true) {#> + public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, out <#=type.TypeName#> ret) +<# } else if (method.MethodType == MethodType.Reduction && method.IsNumeric == true && method.SupportsRowSubsets == true) { #> + public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, IEnumerable rows, out <#=type.TypeName#> ret) +<# } else if (method.MethodType == MethodType.Reduction && method.IsNumeric == true) { #> + public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, out <#=type.TypeName#> ret) +<# } else { #> + public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, out bool ret) +<# } #> + { +<# if ((method.IsNumeric && !type.SupportsNumeric) || (method.IsBitwise && !type.SupportsBitwise) || (type.UnsupportedMethods.Contains(method.MethodName))) { #> + throw new NotSupportedException(); +<# } else { #> +<# if ((method.MethodName == "Max" || method.MethodName == "Min" || method.MethodName == "Product" || method.MethodName == "Sum") && method.SupportsRowSubsets == true) { #> + ret = default; + var readOnlySpan = column.Buffers[0].ReadOnlySpan; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer<<#=type.TypeName#>>.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + readOnlySpan = column.Buffers[bufferIndex].ReadOnlySpan; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; +<# if (method.MethodName == "Max") { #> + ret = (<#=type.TypeName#>)(Math.Max(readOnlySpan[(int)row], ret)); +<# } #> +<# if (method.MethodName == "Min") { #> + ret = (<#=type.TypeName#>)(Math.Min(readOnlySpan[(int)row], ret)); +<# } #> +<# if (method.MethodName == "Product") { #> + ret = checked((<#=type.TypeName#>)(readOnlySpan[(int)row] * ret)); +<# } #> +<# if (method.MethodName == "Sum") { #> + ret = checked((<#=type.TypeName#>)(readOnlySpan[(int)row] + ret)); +<# } #> + } +<# } else if ((method.MethodName == "CumulativeMax" || method.MethodName == "CumulativeMin" || method.MethodName == "CumulativeProduct" || method.MethodName == "CumulativeSum") && method.SupportsRowSubsets == true) { #> + var ret = default(<#=type.TypeName#>); + var mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(column.Buffers[0]); + var span = mutableBuffer.Span; + long minRange = 0; + long maxRange = ReadOnlyDataFrameBuffer<<#=type.TypeName#>>.MaxCapacity; + long maxCapacity = maxRange; + IEnumerator enumerator = rows.GetEnumerator(); + if (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; + ret = span[(int)row]; + } + + while (enumerator.MoveNext()) + { + long row = enumerator.Current; + if (row < minRange || row >= maxRange) + { + int bufferIndex = (int)(row / maxCapacity); + mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(column.Buffers[bufferIndex]); + span = mutableBuffer.Span; + minRange = checked(bufferIndex * maxCapacity); + maxRange = checked((bufferIndex + 1) * maxCapacity); + } + row -= minRange; +<# if (method.MethodName == "CumulativeMax") { #> + ret = (<#=type.TypeName#>)Math.Max(span[(int)row], ret); + span[(int)row] = ret; +<# } else if (method.MethodName == "CumulativeMin") { #> + ret = (<#=type.TypeName#>)Math.Min(span[(int)row], ret); + span[(int)row] = ret; +<# } else if (method.MethodName == "CumulativeProduct") { #> + ret = checked((<#=type.TypeName#>)((span[(int)row]) * ret)); + span[(int)row] = ret; +<# } else if (method.MethodName =="CumulativeSum") { #> + ret = checked((<#=type.TypeName#>)((span[(int)row]) + ret)); + span[(int)row] = ret; +<# } #> + } +<# } else if (method.MethodName == "CumulativeMax" || method.MethodName == "CumulativeMin" || method.MethodName == "CumulativeProduct" || method.MethodName == "CumulativeSum" || method.MethodName == "Max" || method.MethodName == "Min" || method.MethodName == "Product" || method.MethodName == "Sum") { #> +<# if (method.MethodName == "CumulativeMax" || method.MethodName == "CumulativeMin") { #> + var ret = column.Buffers[0].ReadOnlySpan[0]; +<# } else if ((method.MethodName == "Max" || method.MethodName == "Min") && method.SupportsRowSubsets == false) { #> + ret = column.Buffers[0].ReadOnlySpan[0]; +<# } else if (method.MethodName == "CumulativeProduct") { #> + var ret = (<#=type.TypeName#>)1; +<# } else if (method.MethodName =="Product" && method.SupportsRowSubsets == false) { #> + ret = (<#=type.TypeName#>)1; +<# } else if (method.MethodName =="CumulativeSum") { #> + var ret = (<#=type.TypeName#>)0; +<# } else if (method.SupportsRowSubsets == false) { #> + ret = (<#=type.TypeName#>)0; +<# } #> + for (int b = 0 ; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; +<# if (method.MethodName == "CumulativeMax" || method.MethodName == "CumulativeMin" || method.MethodName == "CumulativeProduct" || method.MethodName == "CumulativeSum") { #> + var mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; +<# } #> + var readOnlySpan = buffer.ReadOnlySpan; + for (int i = 0; i < readOnlySpan.Length; i++) + { +<# if (method.MethodName == "CumulativeMax") { #> + ret = (<#=type.TypeName#>)(Math.Max(readOnlySpan[i], ret)); + mutableSpan[i] = ret; +<# } #> +<# if (method.MethodName == "CumulativeMin") { #> + ret = (<#=type.TypeName#>)(Math.Min(readOnlySpan[i], ret)); + mutableSpan[i] = ret; +<# } #> +<# if (method.MethodName == "CumulativeProduct") { #> + ret = (<#=type.TypeName#>)(readOnlySpan[i] * ret); + mutableSpan[i] = ret; +<# } #> +<# if (method.MethodName == "CumulativeSum") { #> + ret = (<#=type.TypeName#>)(readOnlySpan[i] + ret); + mutableSpan[i] = ret; +<# } #> +<# if (method.MethodName == "Max") { #> + ret = (<#=type.TypeName#>)(Math.Max(readOnlySpan[i], ret)); +<# } #> +<# if (method.MethodName == "Min") { #> + ret = (<#=type.TypeName#>)(Math.Min(readOnlySpan[i], ret)); +<# } #> +<# if (method.MethodName == "Product") { #> + ret = (<#=type.TypeName#>)(readOnlySpan[i] * ret); +<# } #> +<# if (method.MethodName == "Sum") { #> + ret = (<#=type.TypeName#>)(readOnlySpan[i] + ret); +<# } #> + } +<# if (method.MethodName == "CumulativeMax" || method.MethodName == "CumulativeMin" || method.MethodName == "CumulativeProduct" || method.MethodName == "CumulativeSum") { #> + column.Buffers[b] = mutableBuffer; +<# } #> + } +<# } else if (method.MethodType == MethodType.ElementwiseComputation && method.Operator != null) { #> + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var mutableBuffer = DataFrameBuffer<<#=type.TypeName#>>.GetMutableBuffer(buffer); + var mutableSpan = mutableBuffer.Span; + for (int i = 0; i < mutableSpan.Length; i++) + { + mutableSpan[i] = (<#=type.TypeName#>)(<#=method.Operator#>((decimal)mutableSpan[i])); + } + column.Buffers[b] = mutableBuffer; + } +<# } else if (method.MethodType == MethodType.Reduction) { #> +<# if (method.MethodName == "All") { #> + ret = true; +<# } else if (method.MethodName == "Any") { #> + ret = false; +<# } #> + for (int b = 0; b < column.Buffers.Count; b++) + { + var buffer = column.Buffers[b]; + var span = buffer.ReadOnlySpan; + for (int i = 0; i < span.Length; i++) + { +<# if (method.MethodName == "All") { #> + if (span[i] == false) + { + ret = false; + return; + } +<# } else if (method.MethodName == "Any") { #> + if (span[i] == true) + { + ret = true; + return; + } +<# } #> + } + } +<# } else { #> + throw new NotImplementedException(); +<# } #> +<# } #> + } + +<# } #> + } +<# } #> +} diff --git a/src/Microsoft.Data.Analysis/ReadOnlyDataFrameBuffer.cs b/src/Microsoft.Data.Analysis/ReadOnlyDataFrameBuffer.cs new file mode 100644 index 0000000000..59394eed8e --- /dev/null +++ b/src/Microsoft.Data.Analysis/ReadOnlyDataFrameBuffer.cs @@ -0,0 +1,88 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + /// + /// A basic immutable store to hold values in a DataFrame column. Supports wrapping with an ArrowBuffer + /// + /// + internal class ReadOnlyDataFrameBuffer + where T : struct + { + private readonly ReadOnlyMemory _readOnlyBuffer; + + public virtual ReadOnlyMemory ReadOnlyBuffer => _readOnlyBuffer; + + public ReadOnlyMemory ReadOnlyMemory => RawReadOnlyMemory.Slice(0, Length); + + public ReadOnlyMemory RawReadOnlyMemory + { + get + { + ReadOnlyMemory memory = ReadOnlyBuffer; + return Unsafe.As, ReadOnlyMemory>(ref memory); + } + } + + protected static int Size = Unsafe.SizeOf(); + + protected int Capacity => ReadOnlyBuffer.Length / Size; + + + public static int MaxCapacity => Int32.MaxValue / Size; + + public ReadOnlySpan ReadOnlySpan + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => (MemoryMarshal.Cast(ReadOnlyBuffer.Span)).Slice(0, Length); + } + + public int Length { get; internal set; } + + public ReadOnlyDataFrameBuffer(int numberOfValues = 8) + { + if ((long)numberOfValues * Size > MaxCapacity) + { + throw new ArgumentException($"{numberOfValues} exceeds buffer capacity", nameof(numberOfValues)); + } + _readOnlyBuffer = new byte[numberOfValues * Size]; + } + + public ReadOnlyDataFrameBuffer(ReadOnlyMemory buffer, int length) + { + _readOnlyBuffer = buffer; + Length = length; + } + + internal virtual T this[int index] + { + get + { + if (index > Length) + throw new ArgumentOutOfRangeException(nameof(index)); + return ReadOnlySpan[index]; + } + set => throw new NotSupportedException(); + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + ReadOnlySpan span = ReadOnlySpan; + for (int i = 0; i < Length; i++) + { + sb.Append(span[i]).Append(" "); + } + return sb.ToString(); + } + + } +} diff --git a/src/Microsoft.Data.Analysis/SByteDataFrameColumn.cs b/src/Microsoft.Data.Analysis/SByteDataFrameColumn.cs new file mode 100644 index 0000000000..731614da72 --- /dev/null +++ b/src/Microsoft.Data.Analysis/SByteDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class SByteDataFrameColumn : PrimitiveDataFrameColumn + { + public SByteDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public SByteDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public SByteDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public SByteDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal SByteDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/SingleDataFrameColumn.cs b/src/Microsoft.Data.Analysis/SingleDataFrameColumn.cs new file mode 100644 index 0000000000..e6be6255d0 --- /dev/null +++ b/src/Microsoft.Data.Analysis/SingleDataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class SingleDataFrameColumn : PrimitiveDataFrameColumn + { + public SingleDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public SingleDataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public SingleDataFrameColumn(string name, long length = 0) : base(name, length) { } + + public SingleDataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal SingleDataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/StringDataFrameColumn.BinaryOperations.cs b/src/Microsoft.Data.Analysis/StringDataFrameColumn.BinaryOperations.cs new file mode 100644 index 0000000000..f4faa20ad0 --- /dev/null +++ b/src/Microsoft.Data.Analysis/StringDataFrameColumn.BinaryOperations.cs @@ -0,0 +1,157 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class StringDataFrameColumn : DataFrameColumn + { + /// + public override DataFrameColumn Add(DataFrameColumn column, bool inPlace = false) + { + if (Length != column.Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + StringDataFrameColumn ret = inPlace ? this : Clone(); + for (long i = 0; i < Length; i++) + { + ret[i] += column[i].ToString(); + } + return ret; + } + + public static StringDataFrameColumn operator+(StringDataFrameColumn column, string value) + { + return column.Add(value); + } + + public static StringDataFrameColumn operator+(string value, StringDataFrameColumn column) + { + return Add(value, column); + } + + public static StringDataFrameColumn Add(string value, StringDataFrameColumn right) + { + StringDataFrameColumn ret = right.Clone(); + for (int i = 0; i < ret._stringBuffers.Count; i++) + { + IList buffer = ret._stringBuffers[i]; + int bufferLen = buffer.Count; + for (int j = 0; j < bufferLen; j++) + { + buffer[j] = value + buffer[j]; + } + } + return ret; + } + + public StringDataFrameColumn Add(string value, bool inPlace = false) + { + StringDataFrameColumn ret = inPlace ? this : Clone(); + for (int i = 0; i < ret._stringBuffers.Count; i++) + { + IList buffer = ret._stringBuffers[i]; + int bufferLen = buffer.Count; + for (int j = 0; j < bufferLen; j++) + { + buffer[j] += value; + } + } + return ret; + } + + /// + public override DataFrameColumn Add(T value, bool inPlace = false) + { + return Add(value.ToString(), inPlace); + } + + internal static PrimitiveDataFrameColumn ElementwiseEqualsImplementation(DataFrameColumn left, DataFrameColumn right) + { + if (left.Length != right.Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(right)); + } + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(left.Name, left.Length); + for (long i = 0; i < left.Length; i++) + { + ret[i] = (string)left[i] == right[i]?.ToString(); + } + return ret; + + } + + /// + public override PrimitiveDataFrameColumn ElementwiseEquals(DataFrameColumn column) + { + return ElementwiseEqualsImplementation(this, column); + } + + public PrimitiveDataFrameColumn ElementwiseEquals(string value) + { + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name, Length); + for (long i = 0; i < Length; i++) + { + ret[i] = this[i] == value; + } + return ret; + } + + /// + public override PrimitiveDataFrameColumn ElementwiseEquals(T value) + { + if (value is DataFrameColumn column) + { + return ElementwiseEquals(column); + } + return ElementwiseEquals(value.ToString()); + } + + internal static PrimitiveDataFrameColumn ElementwiseNotEqualsImplementation(DataFrameColumn left, DataFrameColumn column) + { + if (left.Length != column.Length) + { + throw new ArgumentException(Strings.MismatchedColumnLengths, nameof(column)); + } + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(left.Name, left.Length); + for (long i = 0; i < left.Length; i++) + { + ret[i] = (string)left[i] != column[i].ToString(); + } + return ret; + } + + public PrimitiveDataFrameColumn ElementwiseNotEquals(string value) + { + PrimitiveDataFrameColumn ret = new PrimitiveDataFrameColumn(Name, Length); + for (long i = 0; i < Length; i++) + { + ret[i] = this[i] != value; + } + return ret; + } + + /// + public override PrimitiveDataFrameColumn ElementwiseNotEquals(DataFrameColumn column) + { + return ElementwiseNotEqualsImplementation(this, column); + } + + /// + public override PrimitiveDataFrameColumn ElementwiseNotEquals(T value) + { + if (value is DataFrameColumn column) + { + return ElementwiseNotEquals(column); + } + return ElementwiseNotEquals(value.ToString()); + } + } +} diff --git a/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs b/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs new file mode 100644 index 0000000000..92f2be029e --- /dev/null +++ b/src/Microsoft.Data.Analysis/StringDataFrameColumn.cs @@ -0,0 +1,471 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using Microsoft.ML; +using Microsoft.ML.Data; + +namespace Microsoft.Data.Analysis +{ + /// + /// A mutable column to hold strings + /// + /// Is NOT Arrow compatible + public partial class StringDataFrameColumn : DataFrameColumn, IEnumerable + { + private List> _stringBuffers = new List>(); // To store more than intMax number of strings + + public StringDataFrameColumn(string name, long length = 0) : base(name, length, typeof(string)) + { + int numberOfBuffersRequired = Math.Max((int)(length / int.MaxValue), 1); + for (int i = 0; i < numberOfBuffersRequired; i++) + { + long bufferLen = length - _stringBuffers.Count * int.MaxValue; + List buffer = new List((int)Math.Min(int.MaxValue, bufferLen)); + _stringBuffers.Add(buffer); + for (int j = 0; j < bufferLen; j++) + { + buffer.Add(default); + } + } + } + + public StringDataFrameColumn(string name, IEnumerable values) : base(name, 0, typeof(string)) + { + values = values ?? throw new ArgumentNullException(nameof(values)); + if (_stringBuffers.Count == 0) + { + _stringBuffers.Add(new List()); + } + foreach (var value in values) + { + Append(value); + } + } + + private long _nullCount; + public override long NullCount => _nullCount; + + protected internal override void Resize(long length) + { + if (length < Length) + throw new ArgumentException(Strings.CannotResizeDown, nameof(length)); + + for (long i = Length; i < length; i++) + { + Append(null); + } + } + + public void Append(string value) + { + List lastBuffer = _stringBuffers[_stringBuffers.Count - 1]; + if (lastBuffer.Count == int.MaxValue) + { + lastBuffer = new List(); + _stringBuffers.Add(lastBuffer); + } + lastBuffer.Add(value); + if (value == null) + _nullCount++; + Length++; + } + + private int GetBufferIndexContainingRowIndex(ref long rowIndex) + { + if (rowIndex > Length) + { + throw new ArgumentOutOfRangeException(Strings.ColumnIndexOutOfRange, nameof(rowIndex)); + } + return (int)(rowIndex / int.MaxValue); + } + + protected override object GetValue(long rowIndex) + { + int bufferIndex = GetBufferIndexContainingRowIndex(ref rowIndex); + return _stringBuffers[bufferIndex][(int)rowIndex]; + } + + protected override IReadOnlyList GetValues(long startIndex, int length) + { + var ret = new List(); + int bufferIndex = GetBufferIndexContainingRowIndex(ref startIndex); + while (ret.Count < length && bufferIndex < _stringBuffers.Count) + { + for (int i = (int)startIndex; ret.Count < length && i < _stringBuffers[bufferIndex].Count; i++) + { + ret.Add(_stringBuffers[bufferIndex][i]); + } + bufferIndex++; + startIndex = 0; + } + return ret; + } + + protected override void SetValue(long rowIndex, object value) + { + if (value == null || value is string) + { + int bufferIndex = GetBufferIndexContainingRowIndex(ref rowIndex); + var oldValue = this[rowIndex]; + _stringBuffers[bufferIndex][(int)rowIndex] = (string)value; + if (oldValue != (string)value) + { + if (value == null) + _nullCount++; + if (oldValue == null && _nullCount > 0) + _nullCount--; + } + } + else + { + throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(string)), nameof(value)); + } + } + + public new string this[long rowIndex] + { + get => (string)GetValue(rowIndex); + set => SetValue(rowIndex, value); + } + + public new List this[long startIndex, int length] + { + get + { + var ret = new List(); + int bufferIndex = GetBufferIndexContainingRowIndex(ref startIndex); + while (ret.Count < length && bufferIndex < _stringBuffers.Count) + { + for (int i = (int)startIndex; ret.Count < length && i < _stringBuffers[bufferIndex].Count; i++) + { + ret.Add(_stringBuffers[bufferIndex][i]); + } + bufferIndex++; + startIndex = 0; + } + return ret; + } + } + + public IEnumerator GetEnumerator() + { + foreach (List buffer in _stringBuffers) + { + foreach (string value in buffer) + { + yield return value; + } + } + } + + protected override IEnumerator GetEnumeratorCore() => GetEnumerator(); + + public override DataFrameColumn Clamp(U min, U max, bool inPlace = false) => throw new NotSupportedException(); + + public override DataFrameColumn Filter(U min, U max) => throw new NotSupportedException(); + + public new StringDataFrameColumn Sort(bool ascending = true) + { + PrimitiveDataFrameColumn columnSortIndices = GetAscendingSortIndices(); + return Clone(columnSortIndices, !ascending, NullCount); + } + + internal override PrimitiveDataFrameColumn GetAscendingSortIndices() + { + GetSortIndices(Comparer.Default, out PrimitiveDataFrameColumn columnSortIndices); + return columnSortIndices; + } + + private void GetSortIndices(Comparer comparer, out PrimitiveDataFrameColumn columnSortIndices) + { + List bufferSortIndices = new List(_stringBuffers.Count); + foreach (List buffer in _stringBuffers) + { + var sortIndices = new int[buffer.Count]; + for (int i = 0; i < buffer.Count; i++) + { + sortIndices[i] = i; + } + // TODO: Refactor the sort routine to also work with IList? + string[] array = buffer.ToArray(); + IntrospectiveSort(array, array.Length, sortIndices, comparer); + bufferSortIndices.Add(sortIndices); + } + // Simple merge sort to build the full column's sort indices + ValueTuple GetFirstNonNullValueStartingAtIndex(int stringBufferIndex, int startIndex) + { + string value = _stringBuffers[stringBufferIndex][bufferSortIndices[stringBufferIndex][startIndex]]; + while (value == null && ++startIndex < bufferSortIndices[stringBufferIndex].Length) + { + value = _stringBuffers[stringBufferIndex][bufferSortIndices[stringBufferIndex][startIndex]]; + } + return (value, startIndex); + } + + SortedDictionary>> heapOfValueAndListOfTupleOfSortAndBufferIndex = new SortedDictionary>>(comparer); + List> buffers = _stringBuffers; + for (int i = 0; i < buffers.Count; i++) + { + List buffer = buffers[i]; + ValueTuple valueAndBufferSortIndex = GetFirstNonNullValueStartingAtIndex(i, 0); + if (valueAndBufferSortIndex.Item1 == null) + { + // All nulls + continue; + } + if (heapOfValueAndListOfTupleOfSortAndBufferIndex.ContainsKey(valueAndBufferSortIndex.Item1)) + { + heapOfValueAndListOfTupleOfSortAndBufferIndex[valueAndBufferSortIndex.Item1].Add((valueAndBufferSortIndex.Item2, i)); + } + else + { + heapOfValueAndListOfTupleOfSortAndBufferIndex.Add(valueAndBufferSortIndex.Item1, new List>() { (valueAndBufferSortIndex.Item2, i) }); + } + } + columnSortIndices = new PrimitiveDataFrameColumn("SortIndices"); + GetBufferSortIndex getBufferSortIndex = new GetBufferSortIndex((int bufferIndex, int sortIndex) => (bufferSortIndices[bufferIndex][sortIndex]) + bufferIndex * bufferSortIndices[0].Length); + GetValueAndBufferSortIndexAtBuffer getValueAtBuffer = new GetValueAndBufferSortIndexAtBuffer((int bufferIndex, int sortIndex) => GetFirstNonNullValueStartingAtIndex(bufferIndex, sortIndex)); + GetBufferLengthAtIndex getBufferLengthAtIndex = new GetBufferLengthAtIndex((int bufferIndex) => bufferSortIndices[bufferIndex].Length); + PopulateColumnSortIndicesWithHeap(heapOfValueAndListOfTupleOfSortAndBufferIndex, columnSortIndices, getBufferSortIndex, getValueAtBuffer, getBufferLengthAtIndex); + } + + public new StringDataFrameColumn Clone(DataFrameColumn mapIndices, bool invertMapIndices, long numberOfNullsToAppend) + { + StringDataFrameColumn clone; + if (!(mapIndices is null)) + { + Type dataType = mapIndices.DataType; + if (dataType != typeof(long) && dataType != typeof(int) && dataType != typeof(bool)) + throw new ArgumentException(String.Format(Strings.MultipleMismatchedValueType, typeof(long), typeof(int), typeof(bool)), nameof(mapIndices)); + if (mapIndices.DataType == typeof(long)) + clone = Clone(mapIndices as PrimitiveDataFrameColumn, invertMapIndices); + else if (dataType == typeof(int)) + clone = Clone(mapIndices as PrimitiveDataFrameColumn, invertMapIndices); + else + clone = Clone(mapIndices as PrimitiveDataFrameColumn); + } + else + { + clone = Clone(); + } + for (long i = 0; i < numberOfNullsToAppend; i++) + { + clone.Append(null); + } + return clone; + } + + protected override DataFrameColumn CloneImplementation(DataFrameColumn mapIndices = null, bool invertMapIndices = false, long numberOfNullsToAppend = 0) + { + return Clone(mapIndices, invertMapIndices, numberOfNullsToAppend); + } + + private StringDataFrameColumn Clone(PrimitiveDataFrameColumn boolColumn) + { + if (boolColumn.Length > Length) + throw new ArgumentException(Strings.MapIndicesExceedsColumnLenth, nameof(boolColumn)); + StringDataFrameColumn ret = new StringDataFrameColumn(Name, 0); + for (long i = 0; i < boolColumn.Length; i++) + { + bool? value = boolColumn[i]; + if (value.HasValue && value.Value == true) + ret.Append(this[i]); + } + return ret; + } + + private StringDataFrameColumn CloneImplementation(PrimitiveDataFrameColumn mapIndices, bool invertMapIndices = false) + where U : unmanaged + { + mapIndices = mapIndices ?? throw new ArgumentNullException(nameof(mapIndices)); + StringDataFrameColumn ret = new StringDataFrameColumn(Name, mapIndices.Length); + + List setBuffer = ret._stringBuffers[0]; + long setBufferMinRange = 0; + long setBufferMaxRange = int.MaxValue; + List getBuffer = _stringBuffers[0]; + long getBufferMinRange = 0; + long getBufferMaxRange = int.MaxValue; + long maxCapacity = int.MaxValue; + if (mapIndices.DataType == typeof(long)) + { + PrimitiveDataFrameColumn longMapIndices = mapIndices as PrimitiveDataFrameColumn; + longMapIndices.ApplyElementwise((long? mapIndex, long rowIndex) => + { + long index = rowIndex; + if (invertMapIndices) + index = longMapIndices.Length - 1 - index; + if (index < setBufferMinRange || index >= setBufferMaxRange) + { + int bufferIndex = (int)(index / maxCapacity); + setBuffer = ret._stringBuffers[bufferIndex]; + setBufferMinRange = bufferIndex * maxCapacity; + setBufferMaxRange = (bufferIndex + 1) * maxCapacity; + } + index -= setBufferMinRange; + if (mapIndex == null) + { + setBuffer[(int)index] = null; + ret._nullCount++; + return mapIndex; + } + + if (mapIndex.Value < getBufferMinRange || mapIndex.Value >= getBufferMaxRange) + { + int bufferIndex = (int)(mapIndex.Value / maxCapacity); + getBuffer = _stringBuffers[bufferIndex]; + getBufferMinRange = bufferIndex * maxCapacity; + getBufferMaxRange = (bufferIndex + 1) * maxCapacity; + } + int bufferLocalMapIndex = (int)(mapIndex - getBufferMinRange); + string value = getBuffer[bufferLocalMapIndex]; + setBuffer[(int)index] = value; + if (value == null) + ret._nullCount++; + + return mapIndex; + }); + } + else if (mapIndices.DataType == typeof(int)) + { + PrimitiveDataFrameColumn intMapIndices = mapIndices as PrimitiveDataFrameColumn; + intMapIndices.ApplyElementwise((int? mapIndex, long rowIndex) => + { + long index = rowIndex; + if (invertMapIndices) + index = intMapIndices.Length - 1 - index; + + if (mapIndex == null) + { + setBuffer[(int)index] = null; + ret._nullCount++; + return mapIndex; + } + string value = getBuffer[mapIndex.Value]; + setBuffer[(int)index] = value; + if (value == null) + ret._nullCount++; + + return mapIndex; + }); + } + else + { + Debug.Assert(false, nameof(mapIndices.DataType)); + } + + return ret; + } + + private StringDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices = null, bool invertMapIndex = false) + { + if (mapIndices is null) + { + StringDataFrameColumn ret = new StringDataFrameColumn(Name, mapIndices is null ? Length : mapIndices.Length); + for (long i = 0; i < Length; i++) + { + ret[i] = this[i]; + } + return ret; + } + else + { + return CloneImplementation(mapIndices, invertMapIndex); + } + } + + private StringDataFrameColumn Clone(PrimitiveDataFrameColumn mapIndices, bool invertMapIndex = false) + { + return CloneImplementation(mapIndices, invertMapIndex); + } + + internal static DataFrame ValueCountsImplementation(Dictionary> groupedValues) + { + StringDataFrameColumn keys = new StringDataFrameColumn("Values", 0); + PrimitiveDataFrameColumn counts = new PrimitiveDataFrameColumn("Counts"); + foreach (KeyValuePair> keyValuePair in groupedValues) + { + keys.Append(keyValuePair.Key); + counts.Append(keyValuePair.Value.Count); + } + return new DataFrame(new List { keys, counts }); + } + + public override DataFrame ValueCounts() + { + Dictionary> groupedValues = GroupColumnValues(); + return ValueCountsImplementation(groupedValues); + } + + public override GroupBy GroupBy(int columnIndex, DataFrame parent) + { + Dictionary> dictionary = GroupColumnValues(); + return new GroupBy(parent, columnIndex, dictionary); + } + + public override Dictionary> GroupColumnValues() + { + if (typeof(TKey) == typeof(string)) + { + Dictionary> multimap = new Dictionary>(EqualityComparer.Default); + for (long i = 0; i < Length; i++) + { + bool containsKey = multimap.TryGetValue(this[i] ?? default, out ICollection values); + if (containsKey) + { + values.Add(i); + } + else + { + multimap.Add(this[i] ?? default, new List() { i }); + } + } + return multimap as Dictionary>; + } + else + { + throw new NotImplementedException(nameof(TKey)); + } + } + + public StringDataFrameColumn FillNulls(string value, bool inPlace = false) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); + StringDataFrameColumn column = inPlace ? this : Clone(); + + for (long i = 0; i < column.Length; i++) + { + if (column[i] == null) + column[i] = value; + } + return column; + } + + protected override DataFrameColumn FillNullsImplementation(object value, bool inPlace) + { + if (value is string valueString) + return FillNulls(valueString, inPlace); + else + throw new ArgumentException(String.Format(Strings.MismatchedValueType, typeof(string)), nameof(value)); + } + + protected internal override void AddDataViewColumn(DataViewSchema.Builder builder) + { + builder.AddColumn(Name, TextDataViewType.Instance); + } + + protected internal override Delegate GetDataViewGetter(DataViewRowCursor cursor) + { + return CreateValueGetterDelegate(cursor); + } + + private ValueGetter> CreateValueGetterDelegate(DataViewRowCursor cursor) => + (ref ReadOnlyMemory value) => value = this[cursor.Position].AsMemory(); + } +} diff --git a/src/Microsoft.Data.Analysis/TextFieldParser.cs b/src/Microsoft.Data.Analysis/TextFieldParser.cs new file mode 100644 index 0000000000..6cdada1aff --- /dev/null +++ b/src/Microsoft.Data.Analysis/TextFieldParser.cs @@ -0,0 +1,612 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.IO; +using System.Runtime.CompilerServices; +using System.Text; +using System.Text.RegularExpressions; + +namespace Microsoft.Data.Analysis +{ + internal enum FieldType + { + Delimited, + FixedWidth + } + + internal class TextFieldParser : IDisposable + { + private delegate int ChangeBufferFunction(); + + private bool _disposed; + + private TextReader _reader; + + private string[] _commentTokens = null; + + private long _lineNumber = 1; + + private bool _endOfData; + + private string _errorLine = ""; + + private long _errorLineNumber = -1; + + private FieldType _textFieldType = FieldType.Delimited; + + private int[] _fieldWidths; + + private int[] _fieldWidthsCopy; + + private string[] _delimiters; + + private string[] _delimitersCopy; + + private Regex _whiteSpaceRegEx = new Regex("\\s", RegexOptions.CultureInvariant); + + private bool _trimWhiteSpace = true; + + private int _position; + + private int _peekPosition; + + private int _charsRead; + + private const int DEFAULT_BUFFER_LENGTH = 4096; + + private char[] _buffer = new char[DEFAULT_BUFFER_LENGTH]; + + private bool _hasFieldsEnclosedInQuotes = true; + + private int _maxBufferSize = 10000000; + + private bool _leaveOpen; + + private char[] newLineChars = Environment.NewLine.ToCharArray(); + + public string[] CommentTokens + { + get => _commentTokens; + set + { + CheckCommentTokensForWhitespace(value); + _commentTokens = value; + } + } + + public bool EndOfData + { + get + { + if (_endOfData) + { + return _endOfData; + } + if ((_reader == null) | (_buffer == null)) + { + _endOfData = true; + return true; + } + if (PeekNextDataLine() != null) + { + return false; + } + _endOfData = true; + return true; + } + } + + public long LineNumber + { + get + { + if (_lineNumber != -1 && ((_reader.Peek() == -1) & (_position == _charsRead))) + { + // Side effect of a property. Not great. Just leaving it in for now. + CloseReader(); + } + return _lineNumber; + } + } + + public string ErrorLine => _errorLine; + + public long ErrorLineNumber => _errorLineNumber; + + public FieldType TextFieldType + { + get =>_textFieldType; + set + { + ValidateFieldTypeEnumValue(value, "value"); + _textFieldType = value; + } + } + + public int[] FieldWidths + { + get =>_fieldWidths; + private set + { + if (value != null) + { + ValidateFieldWidthsOnInput(value); + _fieldWidthsCopy = (int[])value.Clone(); + } + else + { + _fieldWidthsCopy = null; + } + _fieldWidths = value; + } + } + + public string[] Delimiters + { + get => _delimiters; + private set + { + if (value != null) + { + ValidateDelimiters(value); + _delimitersCopy = (string[])value.Clone(); + } + else + { + _delimitersCopy = null; + } + _delimiters = value; + } + } + + public bool TrimWhiteSpace + { + get =>_trimWhiteSpace; + set + { + _trimWhiteSpace = value; + } + } + + public bool HasFieldsEnclosedInQuotes + { + get =>_hasFieldsEnclosedInQuotes; + set + { + _hasFieldsEnclosedInQuotes = value; + } + } + + public TextFieldParser(string path) + { + InitializeFromPath(path, Encoding.ASCII, detectEncoding: true); + } + + public TextFieldParser(string path, Encoding defaultEncoding) + { + InitializeFromPath(path, defaultEncoding, detectEncoding: true); + } + + public TextFieldParser(string path, Encoding defaultEncoding, bool detectEncoding) + { + InitializeFromPath(path, defaultEncoding, detectEncoding); + } + + public TextFieldParser(Stream stream) + { + InitializeFromStream(stream, Encoding.ASCII, detectEncoding: true); + } + + public TextFieldParser(Stream stream, Encoding defaultEncoding) + { + InitializeFromStream(stream, defaultEncoding, detectEncoding: true); + } + + public TextFieldParser(Stream stream, Encoding defaultEncoding, bool detectEncoding) + { + InitializeFromStream(stream, defaultEncoding, detectEncoding); + } + + public TextFieldParser(Stream stream, Encoding defaultEncoding, bool detectEncoding, bool leaveOpen) + { + _leaveOpen = leaveOpen; + InitializeFromStream(stream, defaultEncoding, detectEncoding); + } + + public TextFieldParser(TextReader reader) + { + _reader = reader ?? throw new ArgumentNullException(nameof(reader)); + ReadToBuffer(); + } + + public void SetDelimiters(params string[] delimiters) + { + Delimiters = delimiters; + } + + public void SetFieldWidths(params int[] fieldWidths) + { + FieldWidths = fieldWidths; + } + + + public string ReadLine() + { + if ((_reader == null) | (_buffer == null)) + { + return null; + } + + ChangeBufferFunction BufferFunction = ReadToBuffer; + string line = ReadNextLine(ref _position, BufferFunction); + if (line == null) + { + FinishReading(); + return null; + } + + _lineNumber++; + return line.TrimEnd(newLineChars); + } + + /// + /// Peek at characters of the next data line without reading the line + /// + ///The number of characters to look at in the next data line. + ///A string consisting of the first characters of the next line. >If numberOfChars is greater than the next line, only the next line is returned + public string PeekChars(int numberOfChars) + { + if (numberOfChars <= 0) + { + throw new ArgumentException($"{nameof(numberOfChars)} must be greater than 0"); + } + + if ((_reader == null) | (_buffer == null)) + { + return null; + } + + if (_endOfData) + { + return null; + } + + string line = PeekNextDataLine(); + if (line == null) + { + _endOfData = true; + return null; + } + + line = line.TrimEnd(newLineChars); + if (line.Length < numberOfChars) + { + return line; + } + + return line.Substring(0, numberOfChars); + } + + + public string ReadToEnd() + { + if ((_reader == null) | (_buffer == null)) + { + return null; + } + StringBuilder builder = new StringBuilder(_buffer.Length); + builder.Append(_buffer, _position, _charsRead - _position); + builder.Append(_reader.ReadToEnd()); + FinishReading(); + return builder.ToString(); + } + + public void Close() + { + CloseReader(); + } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + if (!_disposed) + { + Close(); + } + _disposed = true; + } + } + + private void ValidateFieldTypeEnumValue(FieldType value, string paramName) + { + if (value < FieldType.Delimited || value > FieldType.FixedWidth) + { + throw new InvalidEnumArgumentException(paramName, (int)value, typeof(FieldType)); + } + } + + private void CloseReader() + { + FinishReading(); + if (_reader != null) + { + if (!_leaveOpen) + { + _reader.Close(); + } + _reader = null; + } + } + + private void FinishReading() + { + _lineNumber = -1L; + _endOfData = true; + _buffer = null; + } + + private void InitializeFromPath(string path, Encoding defaultEncoding, bool detectEncoding) + { + if (path == null) + { + throw new ArgumentNullException(nameof(path)); + } + if (defaultEncoding == null) + { + throw new ArgumentNullException(nameof(defaultEncoding)); + } + string fullPath = ValidatePath(path); + FileStream fileStreamTemp = new FileStream(fullPath, (FileMode.Open), (FileAccess.Read), (FileShare.ReadWrite)); + _reader = new StreamReader(fileStreamTemp, defaultEncoding, detectEncoding); + ReadToBuffer(); + } + + private void InitializeFromStream(Stream stream, Encoding defaultEncoding, bool detectEncoding) + { + if (stream == null) + { + throw new ArgumentNullException(nameof(stream)); + } + if (!stream.CanRead) + { + throw new ArgumentException("stream can't read"); + } + if (defaultEncoding == null) + { + throw new ArgumentNullException(nameof(defaultEncoding)); + } + _reader = new StreamReader(stream, defaultEncoding, detectEncoding); + ReadToBuffer(); + } + + private string ValidatePath(string path) + { + if (!File.Exists(path)) + { + throw new FileNotFoundException($"{path} not found."); + } + return path; + } + + private bool IgnoreLine(string line) + { + if (line == null) + { + return false; + } + string trimmedLine = line.Trim(); + if (trimmedLine.Length == 0) + { + return true; + } + if (_commentTokens != null) + { + string[] commentTokens = _commentTokens; + foreach (string Token in commentTokens) + { + if (Token == string.Empty) + { + continue; + } + if (trimmedLine.StartsWith(Token, StringComparison.Ordinal)) + { + return true; + } + if (line.StartsWith(Token, StringComparison.Ordinal)) + { + return true; + } + } + } + return false; + } + + private int ReadToBuffer() + { + Debug.Assert(_buffer != null, "There's no buffer"); + Debug.Assert(_reader != null, "There's no StreamReader"); + _position = 0; + int BufferLength = _buffer.Length; + Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default"); + if (BufferLength > DEFAULT_BUFFER_LENGTH) + { + BufferLength = DEFAULT_BUFFER_LENGTH; + _buffer = new char[BufferLength]; + } + _charsRead = _reader.Read(_buffer, 0, BufferLength); + return _charsRead; + } + + private int SlideCursorToStartOfBuffer() + { + Debug.Assert(_buffer != null, "There's no buffer"); + Debug.Assert(_reader != null, "There's no StreamReader"); + Debug.Assert((_position >= 0) & (_position <= _buffer.Length), "The cursor is out of range"); + if (_position > 0) + { + int bufferLength = _buffer.Length; + char[] tempArray = new char[bufferLength]; + Array.Copy(_buffer, _position, tempArray, 0, bufferLength - _position); + int charsRead = _reader.Read(tempArray, bufferLength - _position, _position); + _charsRead = _charsRead - _position + charsRead; + _position = 0; + _buffer = tempArray; + return charsRead; + } + return 0; + } + + private int IncreaseBufferSize() + { + Debug.Assert(_buffer != null, "There's no buffer"); + Debug.Assert(_reader != null, "There's no StreamReader"); + _peekPosition = _charsRead; + int bufferSize = _buffer.Length + DEFAULT_BUFFER_LENGTH; + if (bufferSize > _maxBufferSize) + { + throw new Exception("Exceeded maximum buffer size"); + } + char[] tempArray = new char[bufferSize]; + Array.Copy(_buffer, tempArray, _buffer.Length); + int charsRead = _reader.Read(tempArray, _buffer.Length, DEFAULT_BUFFER_LENGTH); + _buffer = tempArray; + _charsRead += charsRead; + Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for"); + return charsRead; + } + + private string PeekNextDataLine() + { + ChangeBufferFunction BufferFunction = IncreaseBufferSize; + SlideCursorToStartOfBuffer(); + _peekPosition = 0; + string line; + do + { + line = ReadNextLine(ref _peekPosition, BufferFunction); + } + while (IgnoreLine(line)); + return line; + } + + private string ReadNextLine(ref int cursor, ChangeBufferFunction changeBuffer) + { + Debug.Assert(_buffer != null, "There's no buffer"); + Debug.Assert((cursor >= 0) & (cursor <= _charsRead), "The cursor is out of range"); + if (cursor == _charsRead && changeBuffer() == 0) + { + return null; + } + StringBuilder Builder = null; + // Consider replacing this do-while with a string search to take advantage of vectorization + do + { + for (int i = cursor; i <= _charsRead - 1; i++) + { + char Character = _buffer[i]; + if (!(Character.Equals('\r') | Character.Equals('\n'))) + { + continue; + } + if (Builder != null) + { + Builder.Append(_buffer, cursor, i - cursor + 1); + } + else + { + Builder = new StringBuilder(i + 1); + Builder.Append(_buffer, cursor, i - cursor + 1); + } + cursor = i + 1; + if (Character.Equals('\r')) + { + if (cursor < _charsRead) + { + if (_buffer[cursor].Equals('\n')) + { + cursor++; + Builder.Append("\n"); + } + } + else if (changeBuffer() > 0 && _buffer[cursor].Equals('\n')) + { + cursor++; + Builder.Append("\n"); + } + } + return Builder.ToString(); + } + + // Searched the whole buffer and haven't found an end of line. Save what we have and read more to the buffer + int Size = _charsRead - cursor; + if (Builder == null) + { + Builder = new StringBuilder(Size + 10); + } + Builder.Append(_buffer, cursor, Size); + } + while (changeBuffer() > 0); + + return Builder.ToString(); + } + + private void ValidateFieldWidthsOnInput(int[] widths) + { + Debug.Assert(widths != null, "There are no field widths"); + int bound = widths.Length - 1; + for (int i = 0; i <= bound - 1; i++) + { + if (widths[i] < 1) + { + throw new ArgumentException("All field widths, except the last element, must be greater than zero. A field width less than or equal to zero in the last element indicates the last field is of variable length."); + } + } + } + + private void ValidateDelimiters(string[] delimiterArray) + { + if (delimiterArray == null) + { + return; + } + foreach (string delimiter in delimiterArray) + { + if (delimiter == string.Empty) + { + throw new Exception("Delimiter cannot be empty"); + } + if (delimiter.IndexOfAny(newLineChars) > -1) + { + throw new Exception("Delimiter cannot be new line characters"); + } + } + } + + private void CheckCommentTokensForWhitespace(string[] tokens) + { + if (tokens == null) + { + return; + } + foreach (string token in tokens) + { + if (token.Length == 1 && char.IsWhiteSpace(token[0])) + { + throw new Exception("Comment token cannot contain whitespace"); + } + } + } + } +} diff --git a/src/Microsoft.Data.Analysis/UInt16DataFrameColumn.cs b/src/Microsoft.Data.Analysis/UInt16DataFrameColumn.cs new file mode 100644 index 0000000000..e56cdca7f3 --- /dev/null +++ b/src/Microsoft.Data.Analysis/UInt16DataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class UInt16DataFrameColumn : PrimitiveDataFrameColumn + { + public UInt16DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public UInt16DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public UInt16DataFrameColumn(string name, long length = 0) : base(name, length) { } + + public UInt16DataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal UInt16DataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/UInt32DataFrameColumn.cs b/src/Microsoft.Data.Analysis/UInt32DataFrameColumn.cs new file mode 100644 index 0000000000..af114ff41e --- /dev/null +++ b/src/Microsoft.Data.Analysis/UInt32DataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class UInt32DataFrameColumn : PrimitiveDataFrameColumn + { + public UInt32DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public UInt32DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public UInt32DataFrameColumn(string name, long length = 0) : base(name, length) { } + + public UInt32DataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal UInt32DataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/UInt64DataFrameColumn.cs b/src/Microsoft.Data.Analysis/UInt64DataFrameColumn.cs new file mode 100644 index 0000000000..cb74704319 --- /dev/null +++ b/src/Microsoft.Data.Analysis/UInt64DataFrameColumn.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Data.Analysis +{ + public partial class UInt64DataFrameColumn : PrimitiveDataFrameColumn + { + public UInt64DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public UInt64DataFrameColumn(string name, IEnumerable values) : base(name, values) { } + + public UInt64DataFrameColumn(string name, long length = 0) : base(name, length) { } + + public UInt64DataFrameColumn(string name, ReadOnlyMemory buffer, ReadOnlyMemory nullBitMap, int length = 0, int nullCount = 0) : base(name, buffer, nullBitMap, length, nullCount) { } + + internal UInt64DataFrameColumn(string name, PrimitiveColumnContainer values) : base(name, values) { } + } +} diff --git a/src/Microsoft.Data.Analysis/strings.Designer.cs b/src/Microsoft.Data.Analysis/strings.Designer.cs new file mode 100644 index 0000000000..030a79a8a3 --- /dev/null +++ b/src/Microsoft.Data.Analysis/strings.Designer.cs @@ -0,0 +1,279 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Data { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Data.Analysis.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Cannot cast column holding {0} values to type {1}. + /// + internal static string BadColumnCast { + get { + return ResourceManager.GetString("BadColumnCast", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot resize down. + /// + internal static string CannotResizeDown { + get { + return ResourceManager.GetString("CannotResizeDown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Index cannot be greater than the Column's Length. + /// + internal static string ColumnIndexOutOfRange { + get { + return ResourceManager.GetString("ColumnIndexOutOfRange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DataType. + /// + internal static string DataType { + get { + return ResourceManager.GetString("DataType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Length (excluding null values). + /// + internal static string DescriptionMethodLength { + get { + return ResourceManager.GetString("DescriptionMethodLength", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DataFrame already contains a column called {0}. + /// + internal static string DuplicateColumnName { + get { + return ResourceManager.GetString("DuplicateColumnName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Empty file. + /// + internal static string EmptyFile { + get { + return ResourceManager.GetString("EmptyFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter.Count exceeds the number of columns({0}) in the DataFrame . + /// + internal static string ExceedsNumberOfColumns { + get { + return ResourceManager.GetString("ExceedsNumberOfColumns", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parameter.Count exceeds the number of rows({0}) in the DataFrame . + /// + internal static string ExceedsNumberOfRows { + get { + return ResourceManager.GetString("ExceedsNumberOfRows", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected either {0} or {1} to be provided. + /// + internal static string ExpectedEitherGuessRowsOrDataTypes { + get { + return ResourceManager.GetString("ExpectedEitherGuessRowsOrDataTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column is immutable. + /// + internal static string ImmutableColumn { + get { + return ResourceManager.GetString("ImmutableColumn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Inconsistent null bitmap and data buffer lengths. + /// + internal static string InconsistentNullBitMapAndLength { + get { + return ResourceManager.GetString("InconsistentNullBitMapAndLength", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Inconsistent null bitmaps and NullCounts. + /// + internal static string InconsistentNullBitMapAndNullCount { + get { + return ResourceManager.GetString("InconsistentNullBitMapAndNullCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column does not exist. + /// + internal static string InvalidColumnName { + get { + return ResourceManager.GetString("InvalidColumnName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Line {0} has less columns than expected. + /// + internal static string LessColumnsThatExpected { + get { + return ResourceManager.GetString("LessColumnsThatExpected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MapIndices exceeds column length. + /// + internal static string MapIndicesExceedsColumnLenth { + get { + return ResourceManager.GetString("MapIndicesExceedsColumnLenth", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Column lengths are mismatched. + /// + internal static string MismatchedColumnLengths { + get { + return ResourceManager.GetString("MismatchedColumnLengths", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected column to hold values of type {0}. + /// + internal static string MismatchedColumnValueType { + get { + return ResourceManager.GetString("MismatchedColumnValueType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to rowCount differs from Column length for Column . + /// + internal static string MismatchedRowCount { + get { + return ResourceManager.GetString("MismatchedRowCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected value to be of type {0}. + /// + internal static string MismatchedValueType { + get { + return ResourceManager.GetString("MismatchedValueType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected value to be of type {0}, {1} or {2}. + /// + internal static string MultipleMismatchedValueType { + get { + return ResourceManager.GetString("MultipleMismatchedValueType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Expected a seekable stream. + /// + internal static string NonSeekableStream { + get { + return ResourceManager.GetString("NonSeekableStream", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to numeric column. + /// + internal static string NumericColumnType { + get { + return ResourceManager.GetString("NumericColumnType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot span multiple buffers. + /// + internal static string SpansMultipleBuffers { + get { + return ResourceManager.GetString("SpansMultipleBuffers", resourceCulture); + } + } + } +} diff --git a/src/Microsoft.Data.Analysis/strings.resx b/src/Microsoft.Data.Analysis/strings.resx new file mode 100644 index 0000000000..267140834a --- /dev/null +++ b/src/Microsoft.Data.Analysis/strings.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cannot cast column holding {0} values to type {1} + + + Cannot resize down + + + Index cannot be greater than the Column's Length + + + DataType + + + Length (excluding null values) + + + DataFrame already contains a column called {0} + + + Empty file + + + Parameter.Count exceeds the number of columns({0}) in the DataFrame + + + Parameter.Count exceeds the number of rows({0}) in the DataFrame + + + Expected either {0} or {1} to be provided + + + Column is immutable + + + Inconsistent null bitmap and data buffer lengths + + + Inconsistent null bitmaps and NullCounts + + + Column does not exist + + + Line {0} has less columns than expected + + + MapIndices exceeds column length + + + Column lengths are mismatched + + + Expected column to hold values of type {0} + + + rowCount differs from Column length for Column + + + Expected value to be of type {0} + + + Expected value to be of type {0}, {1} or {2} + + + Expected a seekable stream + + + numeric column + + + Cannot span multiple buffers + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 303d63b310..08cd4f3da6 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -33,14 +33,6 @@ - - - - - - - - x)); + DataFrameColumn dataFrameColumn2 = new Int32DataFrameColumn("Int2", Enumerable.Range(10, length).Select(x => x)); + if (withNulls) + { + dataFrameColumn1[length / 2] = null; + dataFrameColumn2[length / 2] = null; + } + DataFrame dataFrame = new DataFrame(); + dataFrame.Columns.Insert(0, dataFrameColumn1); + dataFrame.Columns.Insert(1, dataFrameColumn2); + return dataFrame; + } + + [Fact] + public void LessThanTenRowsDataFrameTest() + { + DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 5); + DataFrameKernelExtension.RegisterDataFrame(); + var html = dataFrame.ToDisplayString("text/html"); + + Assert.Contains(TABLE_HTML_PART, html); + Assert.DoesNotContain(BUTTON_HTML_PART, html); + } + + [Fact] + public void MoreThanTenRowsDataFrameTest() + { + DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 21); + DataFrameKernelExtension.RegisterDataFrame(); + var html = dataFrame.ToDisplayString("text/html"); + + Assert.Contains(TABLE_HTML_PART, html); + Assert.Contains(BUTTON_HTML_PART, html); + } + + [Fact] + public void DataFrameInfoTest() + { + DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 5); + DataFrameKernelExtension.RegisterDataFrame(); + var html = dataFrame.Info().ToDisplayString("text/html"); + + Assert.Contains(TABLE_HTML_PART, html); + Assert.DoesNotContain(BUTTON_HTML_PART, html); + } + } +} diff --git a/test/Microsoft.Data.Analysis.Interactive.Tests/Microsoft.Data.Analysis.Interactive.Tests.csproj b/test/Microsoft.Data.Analysis.Interactive.Tests/Microsoft.Data.Analysis.Interactive.Tests.csproj new file mode 100644 index 0000000000..e96eca5c58 --- /dev/null +++ b/test/Microsoft.Data.Analysis.Interactive.Tests/Microsoft.Data.Analysis.Interactive.Tests.csproj @@ -0,0 +1,15 @@ + + + netcoreapp3.1 + $(NoWarn);MSML_PrivateFieldName;MSML_ExtendBaseTestClass + + + + + + + + + + + diff --git a/test/Microsoft.Data.Analysis.Tests/ArrayComparer.cs b/test/Microsoft.Data.Analysis.Tests/ArrayComparer.cs new file mode 100644 index 0000000000..1a5db939b2 --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/ArrayComparer.cs @@ -0,0 +1,200 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Linq; +using Apache.Arrow; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public class ArrayComparer : + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor, + IArrowArrayVisitor + { + private readonly IArrowArray _expectedArray; + + public ArrayComparer(IArrowArray expectedArray) + { + _expectedArray = expectedArray; + } + + public void Visit(Int8Array array) => CompareArrays(array); + public void Visit(Int16Array array) => CompareArrays(array); + public void Visit(Int32Array array) => CompareArrays(array); + public void Visit(Int64Array array) => CompareArrays(array); + public void Visit(UInt8Array array) => CompareArrays(array); + public void Visit(UInt16Array array) => CompareArrays(array); + public void Visit(UInt32Array array) => CompareArrays(array); + public void Visit(UInt64Array array) => CompareArrays(array); + public void Visit(FloatArray array) => CompareArrays(array); + public void Visit(DoubleArray array) => CompareArrays(array); + public void Visit(BooleanArray array) => CompareArrays(array); + public void Visit(TimestampArray array) => CompareArrays(array); + public void Visit(Date32Array array) => CompareArrays(array); + public void Visit(Date64Array array) => CompareArrays(array); + public void Visit(ListArray array) => throw new NotImplementedException(); + public void Visit(StringArray array) => CompareArrays(array); + public void Visit(BinaryArray array) => throw new NotImplementedException(); + public void Visit(IArrowArray array) => throw new NotImplementedException(); + + public void Visit(StructArray array) + { + Assert.IsAssignableFrom(_expectedArray); + StructArray expectedArray = (StructArray)_expectedArray; + + Assert.Equal(expectedArray.Length, array.Length); + Assert.Equal(expectedArray.NullCount, array.NullCount); + Assert.Equal(expectedArray.Offset, array.Offset); + Assert.Equal(expectedArray.Data.Children.Length, array.Data.Children.Length); + Assert.Equal(expectedArray.Fields.Count, array.Fields.Count); + + for (int i = 0; i < array.Fields.Count; i++) + { + array.Fields[i].Accept(new ArrayComparer(expectedArray.Fields[i])); + } + } + + private void CompareArrays(PrimitiveArray actualArray) + where T : struct, IEquatable + { + Assert.IsAssignableFrom>(_expectedArray); + PrimitiveArray expectedArray = (PrimitiveArray)_expectedArray; + + Assert.Equal(expectedArray.Length, actualArray.Length); + Assert.Equal(expectedArray.NullCount, actualArray.NullCount); + Assert.Equal(expectedArray.Offset, actualArray.Offset); + + if (expectedArray.NullCount > 0) + { + Assert.True(expectedArray.NullBitmapBuffer.Span.SequenceEqual(actualArray.NullBitmapBuffer.Span)); + } + else + { + // expectedArray may have passed in a null bitmap. DataFrame might have populated it with Length set bits + Assert.Equal(0, expectedArray.NullCount); + Assert.Equal(0, actualArray.NullCount); + for (int i = 0; i < actualArray.Length; i++) + { + Assert.True(actualArray.IsValid(i)); + } + } + Assert.True(expectedArray.Values.Slice(0, expectedArray.Length).SequenceEqual(actualArray.Values.Slice(0, actualArray.Length))); + } + + private void CompareArrays(BooleanArray actualArray) + { + Assert.IsAssignableFrom(_expectedArray); + BooleanArray expectedArray = (BooleanArray)_expectedArray; + + Assert.Equal(expectedArray.Length, actualArray.Length); + Assert.Equal(expectedArray.NullCount, actualArray.NullCount); + Assert.Equal(expectedArray.Offset, actualArray.Offset); + + Assert.True(expectedArray.NullBitmapBuffer.Span.SequenceEqual(actualArray.NullBitmapBuffer.Span)); + int booleanByteCount = BitUtility.ByteCount(expectedArray.Length); + Assert.True(expectedArray.Values.Slice(0, booleanByteCount).SequenceEqual(actualArray.Values.Slice(0, booleanByteCount))); + } + + private void CompareArrays(StringArray actualArray) + { + Assert.IsAssignableFrom(_expectedArray); + StringArray expectedArray = (StringArray)_expectedArray; + + Assert.Equal(expectedArray.Length, actualArray.Length); + Assert.Equal(expectedArray.NullCount, actualArray.NullCount); + Assert.Equal(expectedArray.Offset, actualArray.Offset); + + Assert.True(expectedArray.NullBitmapBuffer.Span.SequenceEqual(actualArray.NullBitmapBuffer.Span)); + Assert.True(expectedArray.Values.Slice(0, expectedArray.Length).SequenceEqual(actualArray.Values.Slice(0, actualArray.Length))); + } + } + + internal static class FieldComparer + { + public static bool Equals(Field f1, Field f2) + { + if (ReferenceEquals(f1, f2)) + { + return true; + } + if (f2 != null && f1 != null && f1.Name == f2.Name && f1.IsNullable == f2.IsNullable && + f1.DataType.TypeId == f2.DataType.TypeId && f1.HasMetadata == f2.HasMetadata) + { + if (f1.HasMetadata && f2.HasMetadata) + { + return f1.Metadata.Keys.Count() == f2.Metadata.Keys.Count() && + f1.Metadata.Keys.All(k => f2.Metadata.ContainsKey(k) && f1.Metadata[k] == f2.Metadata[k]) && + f2.Metadata.Keys.All(k => f1.Metadata.ContainsKey(k) && f2.Metadata[k] == f1.Metadata[k]); + } + return true; + } + return false; + } + } + + internal static class SchemaComparer + { + public static bool Equals(Schema s1, Schema s2) + { + if (ReferenceEquals(s1, s2)) + { + return true; + } + if (s2 == null || s1 == null || s1.HasMetadata != s2.HasMetadata || s1.Fields.Count != s2.Fields.Count) + { + return false; + } + + if (!s1.Fields.Keys.All(k => s2.Fields.ContainsKey(k) && FieldComparer.Equals(s1.Fields[k], s2.Fields[k])) || + !s2.Fields.Keys.All(k => s1.Fields.ContainsKey(k) && FieldComparer.Equals(s2.Fields[k], s1.Fields[k]))) + { + return false; + } + + if (s1.HasMetadata && s2.HasMetadata) + { + return s1.Metadata.Keys.Count() == s2.Metadata.Keys.Count() && + s1.Metadata.Keys.All(k => s2.Metadata.ContainsKey(k) && s1.Metadata[k] == s2.Metadata[k]) && + s2.Metadata.Keys.All(k => s1.Metadata.ContainsKey(k) && s2.Metadata[k] == s1.Metadata[k]); + } + return true; + } + } + + public static class RecordBatchComparer + { + public static void CompareBatches(RecordBatch expectedBatch, RecordBatch actualBatch) + { + Assert.True(SchemaComparer.Equals(expectedBatch.Schema, actualBatch.Schema)); + Assert.Equal(expectedBatch.Length, actualBatch.Length); + Assert.Equal(expectedBatch.ColumnCount, actualBatch.ColumnCount); + + for (int i = 0; i < expectedBatch.ColumnCount; i++) + { + IArrowArray expectedArray = expectedBatch.Arrays.ElementAt(i); + IArrowArray actualArray = actualBatch.Arrays.ElementAt(i); + + actualArray.Accept(new ArrayComparer(expectedArray)); + } + } + + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/ArrowIntegrationTests.cs b/test/Microsoft.Data.Analysis.Tests/ArrowIntegrationTests.cs new file mode 100644 index 0000000000..dacf43a8db --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/ArrowIntegrationTests.cs @@ -0,0 +1,225 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Apache.Arrow; +using Apache.Arrow.Ipc; +using Apache.Arrow.Types; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public class ArrowIntegrationTests + { + [Fact] + public void TestArrowIntegration() + { + RecordBatch originalBatch = new RecordBatch.Builder() + .Append("Column1", false, col => col.Int32(array => array.AppendRange(Enumerable.Range(0, 10)))) + .Append("Column2", true, new Int32Array( + valueBuffer: new ArrowBuffer.Builder().AppendRange(Enumerable.Range(0, 10)).Build(), + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0xfd).Append(0xff).Build(), + length: 10, + nullCount: 1, + offset: 0)) + .Append("Column3", true, new Int32Array( + valueBuffer: new ArrowBuffer.Builder().AppendRange(Enumerable.Range(0, 10)).Build(), + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0x00).Append(0x00).Build(), + length: 10, + nullCount: 10, + offset: 0)) + .Append("NullableBooleanColumn", true, new BooleanArray( + valueBuffer: new ArrowBuffer.Builder().Append(0xfd).Append(0xff).Build(), + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0xed).Append(0xff).Build(), + length: 10, + nullCount: 2, + offset: 0)) + .Append("StringDataFrameColumn", false, new StringArray.Builder().AppendRange(Enumerable.Range(0, 10).Select(x => x.ToString())).Build()) + .Append("DoubleColumn", false, new DoubleArray.Builder().AppendRange(Enumerable.Repeat(1.0, 10)).Build()) + .Append("FloatColumn", false, new FloatArray.Builder().AppendRange(Enumerable.Repeat(1.0f, 10)).Build()) + .Append("ShortColumn", false, new Int16Array.Builder().AppendRange(Enumerable.Repeat((short)1, 10)).Build()) + .Append("LongColumn", false, new Int64Array.Builder().AppendRange(Enumerable.Repeat((long)1, 10)).Build()) + .Append("UIntColumn", false, new UInt32Array.Builder().AppendRange(Enumerable.Repeat((uint)1, 10)).Build()) + .Append("UShortColumn", false, new UInt16Array.Builder().AppendRange(Enumerable.Repeat((ushort)1, 10)).Build()) + .Append("ULongColumn", false, new UInt64Array.Builder().AppendRange(Enumerable.Repeat((ulong)1, 10)).Build()) + .Append("ByteColumn", false, new Int8Array.Builder().AppendRange(Enumerable.Repeat((sbyte)1, 10)).Build()) + .Append("UByteColumn", false, new UInt8Array.Builder().AppendRange(Enumerable.Repeat((byte)1, 10)).Build()) + .Build(); + + DataFrame df = DataFrame.FromArrowRecordBatch(originalBatch); + DataFrameIOTests.VerifyColumnTypes(df, testArrowStringColumn: true); + + IEnumerable recordBatches = df.ToArrowRecordBatches(); + + foreach (RecordBatch batch in recordBatches) + { + RecordBatchComparer.CompareBatches(originalBatch, batch); + } + } + + [Fact] + public void TestRecordBatchWithStructArrays() + { + RecordBatch CreateRecordBatch(string prependColumnNamesWith = "") + { + RecordBatch ret = new RecordBatch.Builder() + .Append(prependColumnNamesWith + "Column1", false, col => col.Int32(array => array.AppendRange(Enumerable.Range(0, 10)))) + .Append(prependColumnNamesWith + "Column2", true, new Int32Array( + valueBuffer: new ArrowBuffer.Builder().AppendRange(Enumerable.Range(0, 10)).Build(), + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0xfd).Append(0xff).Build(), + length: 10, + nullCount: 1, + offset: 0)) + .Append(prependColumnNamesWith + "Column3", true, new Int32Array( + valueBuffer: new ArrowBuffer.Builder().AppendRange(Enumerable.Range(0, 10)).Build(), + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0x00).Append(0x00).Build(), + length: 10, + nullCount: 10, + offset: 0)) + .Append(prependColumnNamesWith + "NullableBooleanColumn", true, new BooleanArray( + valueBuffer: new ArrowBuffer.Builder().Append(0xfd).Append(0xff).Build(), + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0xed).Append(0xff).Build(), + length: 10, + nullCount: 2, + offset: 0)) + .Append(prependColumnNamesWith + "StringDataFrameColumn", false, new StringArray.Builder().AppendRange(Enumerable.Range(0, 10).Select(x => x.ToString())).Build()) + .Append(prependColumnNamesWith + "DoubleColumn", false, new DoubleArray.Builder().AppendRange(Enumerable.Repeat(1.0, 10)).Build()) + .Append(prependColumnNamesWith + "FloatColumn", false, new FloatArray.Builder().AppendRange(Enumerable.Repeat(1.0f, 10)).Build()) + .Append(prependColumnNamesWith + "ShortColumn", false, new Int16Array.Builder().AppendRange(Enumerable.Repeat((short)1, 10)).Build()) + .Append(prependColumnNamesWith + "LongColumn", false, new Int64Array.Builder().AppendRange(Enumerable.Repeat((long)1, 10)).Build()) + .Append(prependColumnNamesWith + "UIntColumn", false, new UInt32Array.Builder().AppendRange(Enumerable.Repeat((uint)1, 10)).Build()) + .Append(prependColumnNamesWith + "UShortColumn", false, new UInt16Array.Builder().AppendRange(Enumerable.Repeat((ushort)1, 10)).Build()) + .Append(prependColumnNamesWith + "ULongColumn", false, new UInt64Array.Builder().AppendRange(Enumerable.Repeat((ulong)1, 10)).Build()) + .Append(prependColumnNamesWith + "ByteColumn", false, new Int8Array.Builder().AppendRange(Enumerable.Repeat((sbyte)1, 10)).Build()) + .Append(prependColumnNamesWith + "UByteColumn", false, new UInt8Array.Builder().AppendRange(Enumerable.Repeat((byte)1, 10)).Build()) + .Build(); + + return ret; + } + + RecordBatch originalBatch = CreateRecordBatch(); + ArrowBuffer.BitmapBuilder validityBitmapBuilder = new ArrowBuffer.BitmapBuilder(); + for (int i = 0; i < originalBatch.Length; i++) + { + validityBitmapBuilder.Append(true); + } + ArrowBuffer validityBitmap = validityBitmapBuilder.Build(); + + StructType structType = new StructType(originalBatch.Schema.Fields.Select((KeyValuePair pair) => pair.Value).ToList()); + StructArray structArray = new StructArray(structType, originalBatch.Length, originalBatch.Arrays.Cast(), validityBitmap); + Schema schema = new Schema.Builder().Field(new Field("Struct", structType, false)).Build(); + RecordBatch recordBatch = new RecordBatch(schema, new[] { structArray }, originalBatch.Length); + + DataFrame df = DataFrame.FromArrowRecordBatch(recordBatch); + DataFrameIOTests.VerifyColumnTypes(df, testArrowStringColumn: true); + + IEnumerable recordBatches = df.ToArrowRecordBatches(); + + RecordBatch expected = CreateRecordBatch("Struct_"); + foreach (RecordBatch batch in recordBatches) + { + RecordBatchComparer.CompareBatches(expected, batch); + } + } + + [Fact] + public void TestEmptyDataFrameRecordBatch() + { + PrimitiveDataFrameColumn ageColumn = new PrimitiveDataFrameColumn("Age"); + PrimitiveDataFrameColumn lengthColumn = new PrimitiveDataFrameColumn("CharCount"); + ArrowStringDataFrameColumn stringColumn = new ArrowStringDataFrameColumn("Empty"); + DataFrame df = new DataFrame(new List() { ageColumn, lengthColumn, stringColumn }); + + IEnumerable recordBatches = df.ToArrowRecordBatches(); + bool foundARecordBatch = false; + foreach (RecordBatch recordBatch in recordBatches) + { + foundARecordBatch = true; + MemoryStream stream = new MemoryStream(); + ArrowStreamWriter writer = new ArrowStreamWriter(stream, recordBatch.Schema); + writer.WriteRecordBatchAsync(recordBatch).GetAwaiter().GetResult(); + + stream.Position = 0; + ArrowStreamReader reader = new ArrowStreamReader(stream); + RecordBatch readRecordBatch = reader.ReadNextRecordBatch(); + while (readRecordBatch != null) + { + RecordBatchComparer.CompareBatches(recordBatch, readRecordBatch); + readRecordBatch = reader.ReadNextRecordBatch(); + } + } + Assert.True(foundARecordBatch); + } + + [Fact] + public void TestMutationOnArrowColumn() + { + RecordBatch originalBatch = new RecordBatch.Builder() + .Append("Column1", false, col => col.Int32(array => array.AppendRange(Enumerable.Range(0, 10)))).Build(); + DataFrame df = DataFrame.FromArrowRecordBatch(originalBatch); + Assert.Equal(1, df.Columns["Column1"][1]); + df.Columns["Column1"][1] = 100; + Assert.Equal(100, df.Columns["Column1"][1]); + Assert.Equal(0, df.Columns["Column1"].NullCount); + } + + [Fact] + public void TestEmptyArrowColumns() + { + // Tests to ensure that we don't crash and the internal NullCounts stay consistent on encountering: + // 1. Data + Empty null bitmaps + // 2. Empty Data + Null bitmaps + // 3. Empty Data + Empty null bitmaps + RecordBatch originalBatch = new RecordBatch.Builder() + .Append("EmptyNullBitMapColumn", false, col => col.Int32(array => array.AppendRange(Enumerable.Range(0, 10)))) + .Append("EmptyDataColumn", true, new Int32Array( + valueBuffer: ArrowBuffer.Empty, + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0x00).Append(0x00).Build(), + length: 10, + nullCount: 10, + offset: 0)).Build(); + DataFrame df = DataFrame.FromArrowRecordBatch(originalBatch); + Assert.Equal(0, df.Columns["EmptyNullBitMapColumn"].NullCount); + Assert.Equal(10, df.Columns["EmptyNullBitMapColumn"].Length); + df.Columns["EmptyNullBitMapColumn"][9] = null; + Assert.Equal(1, df.Columns["EmptyNullBitMapColumn"].NullCount); + Assert.Equal(10, df.Columns["EmptyDataColumn"].NullCount); + Assert.Equal(10, df.Columns["EmptyDataColumn"].Length); + df.Columns["EmptyDataColumn"][9] = 9; + Assert.Equal(9, df.Columns["EmptyDataColumn"].NullCount); + Assert.Equal(10, df.Columns["EmptyDataColumn"].Length); + for (int i = 0; i < 9; i++) + { + Assert.Equal(i, (int)df.Columns["EmptyNullBitMapColumn"][i]); + Assert.Null(df.Columns["EmptyDataColumn"][i]); + } + + RecordBatch batch1 = new RecordBatch.Builder() + .Append("EmptyDataAndNullColumns", false, col => col.Int32(array => array.Clear())).Build(); + DataFrame emptyDataFrame = DataFrame.FromArrowRecordBatch(batch1); + Assert.Equal(0, emptyDataFrame.Rows.Count); + Assert.Equal(0, emptyDataFrame.Columns["EmptyDataAndNullColumns"].Length); + Assert.Equal(0, emptyDataFrame.Columns["EmptyDataAndNullColumns"].NullCount); + } + + [Fact] + public void TestInconsistentNullBitMapLength() + { + // Arrow allocates buffers of length 64 by default. 64 * 8 = 512 bits in the NullBitMapBuffer. Anything lesser than 512 will not trigger a throw + Int32Array int32 = new Int32Array.Builder().AppendRange(Enumerable.Range(0, 520)).Build(); + RecordBatch originalBatch = new RecordBatch.Builder() + .Append("EmptyDataColumn", true, new Int32Array( + valueBuffer: int32.ValueBuffer, + nullBitmapBuffer: new ArrowBuffer.Builder().Append(0x00).Build(), + length: 520, + nullCount: 520, + offset: 0)).Build(); + + Assert.ThrowsAny(() => DataFrame.FromArrowRecordBatch(originalBatch)); + } + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/BufferTests.cs b/test/Microsoft.Data.Analysis.Tests/BufferTests.cs new file mode 100644 index 0000000000..96f568b6a4 --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/BufferTests.cs @@ -0,0 +1,281 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Apache.Arrow; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public class BufferTests + { + [Fact] + public void TestNullCounts() + { + PrimitiveDataFrameColumn dataFrameColumn1 = new PrimitiveDataFrameColumn("Int1", Enumerable.Range(0, 10).Select(x => x)); + dataFrameColumn1.Append(null); + Assert.Equal(1, dataFrameColumn1.NullCount); + + PrimitiveDataFrameColumn column2 = new PrimitiveDataFrameColumn("Int2"); + Assert.Equal(0, column2.NullCount); + + PrimitiveDataFrameColumn column3 = new PrimitiveDataFrameColumn("Int3", 10); + Assert.Equal(10, column3.NullCount); + + // Test null counts with assignments on Primitive Columns + column2.Append(null); + column2.Append(1); + Assert.Equal(1, column2.NullCount); + column2[1] = 10; + Assert.Equal(1, column2.NullCount); + column2[1] = null; + Assert.Equal(2, column2.NullCount); + column2[1] = 5; + Assert.Equal(1, column2.NullCount); + column2[0] = null; + Assert.Equal(1, column2.NullCount); + + // Test null counts with assignments on String Columns + StringDataFrameColumn strCol = new StringDataFrameColumn("String", 0); + Assert.Equal(0, strCol.NullCount); + + StringDataFrameColumn strCol1 = new StringDataFrameColumn("String1", 5); + Assert.Equal(0, strCol1.NullCount); + + StringDataFrameColumn strCol2 = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString())); + Assert.Equal(0, strCol2.NullCount); + + StringDataFrameColumn strCol3 = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => (string)null)); + Assert.Equal(10, strCol3.NullCount); + + strCol.Append(null); + Assert.Equal(1, strCol.NullCount); + strCol.Append("foo"); + Assert.Equal(1, strCol.NullCount); + strCol[1] = "bar"; + Assert.Equal(1, strCol.NullCount); + strCol[1] = null; + Assert.Equal(2, strCol.NullCount); + strCol[1] = "foo"; + Assert.Equal(1, strCol.NullCount); + strCol[0] = null; + Assert.Equal(1, strCol.NullCount); + + PrimitiveDataFrameColumn intColumn = new PrimitiveDataFrameColumn("Int"); + intColumn.Append(0); + intColumn.Append(1); + intColumn.Append(null); + intColumn.Append(2); + intColumn.Append(null); + intColumn.Append(3); + Assert.Equal(0, intColumn[0]); + Assert.Equal(1, intColumn[1]); + Assert.Null(intColumn[2]); + Assert.Equal(2, intColumn[3]); + Assert.Null(intColumn[4]); + Assert.Equal(3, intColumn[5]); + + } + + [Fact] + public void TestNullCountWithIndexers() + { + PrimitiveDataFrameColumn intColumn = new PrimitiveDataFrameColumn("Int", 5); + Assert.Equal(5, intColumn.NullCount); + intColumn[2] = null; + Assert.Equal(5, intColumn.NullCount); + intColumn[2] = 5; + Assert.Equal(4, intColumn.NullCount); + } + + [Fact] + public void TestValidity() + { + PrimitiveDataFrameColumn dataFrameColumn1 = new PrimitiveDataFrameColumn("Int1", Enumerable.Range(0, 10).Select(x => x)); + dataFrameColumn1.Append(null); + Assert.False(dataFrameColumn1.IsValid(10)); + for (long i = 0; i < dataFrameColumn1.Length - 1; i++) + { + Assert.True(dataFrameColumn1.IsValid(i)); + } + } + + [Fact] + public void TestAppendMany() + { + PrimitiveDataFrameColumn intColumn = new PrimitiveDataFrameColumn("Int1"); + intColumn.AppendMany(null, 5); + Assert.Equal(5, intColumn.NullCount); + Assert.Equal(5, intColumn.Length); + for (int i = 0; i < intColumn.Length; i++) + { + Assert.False(intColumn.IsValid(i)); + } + + intColumn.AppendMany(5, 5); + Assert.Equal(5, intColumn.NullCount); + Assert.Equal(10, intColumn.Length); + for (int i = 5; i < intColumn.Length; i++) + { + Assert.True(intColumn.IsValid(i)); + } + + intColumn[2] = 10; + Assert.Equal(4, intColumn.NullCount); + Assert.True(intColumn.IsValid(2)); + + intColumn[7] = null; + Assert.Equal(5, intColumn.NullCount); + Assert.False(intColumn.IsValid(7)); + } + + [Fact] + public void TestBasicArrowStringColumn() + { + StringArray strArray = new StringArray.Builder().Append("foo").Append("bar").Build(); + Memory dataMemory = new byte[] { 102, 111, 111, 98, 97, 114 }; + Memory nullMemory = new byte[] { 0, 0, 0, 0 }; + Memory offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0 }; + + ArrowStringDataFrameColumn stringColumn = new ArrowStringDataFrameColumn("String", dataMemory, offsetMemory, nullMemory, strArray.Length, strArray.NullCount); + Assert.Equal(2, stringColumn.Length); + Assert.Equal("foo", stringColumn[0]); + Assert.Equal("bar", stringColumn[1]); + } + + [Fact] + public void TestArrowStringColumnWithNulls() + { + string data = "joemark"; + byte[] bytes = Encoding.UTF8.GetBytes(data); + Memory dataMemory = new Memory(bytes); + Memory nullMemory = new byte[] { 0b1101 }; + Memory offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 7, 0, 0, 0 }; + ArrowStringDataFrameColumn stringColumn = new ArrowStringDataFrameColumn("String", dataMemory, offsetMemory, nullMemory, 4, 1); + + Assert.Equal(4, stringColumn.Length); + Assert.Equal("joe", stringColumn[0]); + Assert.Null(stringColumn[1]); + Assert.Equal("mark", stringColumn[2]); + Assert.Equal("", stringColumn[3]); + + List ret = stringColumn[0, 4]; + Assert.Equal("joe", ret[0]); + Assert.Null(ret[1]); + Assert.Equal("mark", ret[2]); + Assert.Equal("", ret[3]); + } + + [Fact] + public void TestArrowStringColumnClone() + { + StringArray strArray = new StringArray.Builder().Append("foo").Append("bar").Build(); + Memory dataMemory = new byte[] { 102, 111, 111, 98, 97, 114 }; + Memory nullMemory = new byte[] { 0, 0, 0, 0 }; + Memory offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0 }; + + ArrowStringDataFrameColumn stringColumn = new ArrowStringDataFrameColumn("String", dataMemory, offsetMemory, nullMemory, strArray.Length, strArray.NullCount); + + DataFrameColumn clone = stringColumn.Clone(numberOfNullsToAppend: 5); + Assert.Equal(7, clone.Length); + Assert.Equal(stringColumn[0], clone[0]); + Assert.Equal(stringColumn[1], clone[1]); + for (int i = 2; i < 7; i++) + Assert.Null(clone[i]); + } + +//#if !NETFRAMEWORK // https://github.com/dotnet/corefxlab/issues/2796 +// [Fact] +// public void TestPrimitiveColumnGetReadOnlyBuffers() +// { +// RecordBatch recordBatch = new RecordBatch.Builder() +// .Append("Column1", false, col => col.Int32(array => array.AppendRange(Enumerable.Range(0, 10)))).Build(); +// DataFrame df = DataFrame.FromArrowRecordBatch(recordBatch); + +// PrimitiveDataFrameColumn column = df.Columns["Column1"] as PrimitiveDataFrameColumn; + +// IEnumerable> buffers = column.GetReadOnlyDataBuffers(); +// IEnumerable> nullBitMaps = column.GetReadOnlyNullBitMapBuffers(); + +// long i = 0; +// IEnumerator> bufferEnumerator = buffers.GetEnumerator(); +// IEnumerator> nullBitMapsEnumerator = nullBitMaps.GetEnumerator(); +// while (bufferEnumerator.MoveNext() && nullBitMapsEnumerator.MoveNext()) +// { +// ReadOnlyMemory dataBuffer = bufferEnumerator.Current; +// ReadOnlyMemory nullBitMap = nullBitMapsEnumerator.Current; + +// ReadOnlySpan span = dataBuffer.Span; +// for (int j = 0; j < span.Length; j++) +// { +// // Each buffer has a max length of int.MaxValue +// Assert.Equal(span[j], column[j + i * int.MaxValue]); +// } + +// bool GetBit(byte curBitMap, int index) +// { +// return ((curBitMap >> (index & 7)) & 1) != 0; +// } +// ReadOnlySpan bitMapSpan = nullBitMap.Span; +// // No nulls in this column, so each bit must be set +// for (int j = 0; j < bitMapSpan.Length; j++) +// { +// for (int k = 0; k < 8; k++) +// { +// if (j * 8 + k == column.Length) +// break; +// Assert.True(GetBit(bitMapSpan[j], k)); +// } +// } +// i++; +// } +// } + +// [Fact] +// public void TestArrowStringColumnGetReadOnlyBuffers() +// { +// // Test ArrowStringDataFrameColumn. +// StringArray strArray = new StringArray.Builder().Append("foo").Append("bar").Build(); +// Memory dataMemory = new byte[] { 102, 111, 111, 98, 97, 114 }; +// Memory nullMemory = new byte[] { 1 }; +// Memory offsetMemory = new byte[] { 0, 0, 0, 0, 3, 0, 0, 0, 6, 0, 0, 0 }; + +// ArrowStringDataFrameColumn column = new ArrowStringDataFrameColumn("String", dataMemory, offsetMemory, nullMemory, strArray.Length, strArray.NullCount); + +// IEnumerable> dataBuffers = column.GetReadOnlyDataBuffers(); +// IEnumerable> nullBitMaps = column.GetReadOnlyNullBitMapBuffers(); +// IEnumerable> offsetsBuffers = column.GetReadOnlyOffsetsBuffers(); + +// using (IEnumerator> bufferEnumerator = dataBuffers.GetEnumerator()) +// using (IEnumerator> offsetsEnumerator = offsetsBuffers.GetEnumerator()) +// using (IEnumerator> nullBitMapsEnumerator = nullBitMaps.GetEnumerator()) +// { +// while (bufferEnumerator.MoveNext() && nullBitMapsEnumerator.MoveNext() && offsetsEnumerator.MoveNext()) +// { +// ReadOnlyMemory dataBuffer = bufferEnumerator.Current; +// ReadOnlyMemory nullBitMap = nullBitMapsEnumerator.Current; +// ReadOnlyMemory offsets = offsetsEnumerator.Current; + +// ReadOnlySpan dataSpan = dataBuffer.Span; +// ReadOnlySpan offsetsSpan = offsets.Span; +// int dataStart = 0; +// for (int j = 1; j < offsetsSpan.Length; j++) +// { +// int length = offsetsSpan[j] - offsetsSpan[j - 1]; +// ReadOnlySpan str = dataSpan.Slice(dataStart, length); +// ReadOnlySpan columnStr = dataMemory.Span.Slice(dataStart, length); +// Assert.Equal(str.Length, columnStr.Length); +// for (int s = 0; s < str.Length; s++) +// Assert.Equal(str[s], columnStr[s]); +// dataStart = length; +// } +// } +// } +// } +//#endif //!NETFRAMEWORK + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/DataFrame.IOTests.cs b/test/Microsoft.Data.Analysis.Tests/DataFrame.IOTests.cs new file mode 100644 index 0000000000..9e8ccb6903 --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/DataFrame.IOTests.cs @@ -0,0 +1,903 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public class DataFrameIOTests + { + internal static void VerifyColumnTypes(DataFrame df, bool testArrowStringColumn = false) + { + foreach (DataFrameColumn column in df.Columns) + { + Type dataType = column.DataType; + if (dataType == typeof(bool)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(decimal)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(byte)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(char)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(double)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(float)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(int)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(long)) + { + + Assert.IsType(column); + } + else if (dataType == typeof(sbyte)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(short)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(uint)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(ulong)) + { + + Assert.IsType(column); + } + else if (dataType == typeof(ushort)) + { + Assert.IsType(column); + + } + else if (dataType == typeof(string)) + { + if (!testArrowStringColumn) + { + Assert.IsType(column); + } + else + { + Assert.IsType(column); + } + } + else + { + throw new NotImplementedException("Unit test has to be updated"); + } + } + } + + [Fact] + public void TestReadCsvWithHeader() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount +CMT,1,1,1271,3.8,CRD,17.5 +CMT,1,1,474,1.5,CRD,8 +CMT,1,1,637,1.4,CRD,8.5 +CMT,1,1,181,0.6,CSH,4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + void RegularTest(DataFrame df) + { + Assert.Equal(4, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + Assert.Equal("CMT", df.Columns["vendor_id"][3]); + VerifyColumnTypes(df); + } + DataFrame df = DataFrame.LoadCsv(GetStream(data)); + RegularTest(df); + DataFrame csvDf = DataFrame.LoadCsvFromString(data); + RegularTest(csvDf); + + void ReducedRowsTest(DataFrame reducedRows) + { + Assert.Equal(3, reducedRows.Rows.Count); + Assert.Equal(7, reducedRows.Columns.Count); + Assert.Equal("CMT", reducedRows.Columns["vendor_id"][2]); + VerifyColumnTypes(df); + } + DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), numberOfRowsToRead: 3); + ReducedRowsTest(reducedRows); + csvDf = DataFrame.LoadCsvFromString(data, numberOfRowsToRead: 3); + ReducedRowsTest(csvDf); + } + + [Fact] + public void TestReadCsvNoHeader() + { + string data = @"CMT,1,1,1271,3.8,CRD,17.5 +CMT,1,1,474,1.5,CRD,8 +CMT,1,1,637,1.4,CRD,8.5 +CMT,1,1,181,0.6,CSH,4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + void RegularTest(DataFrame df) + { + Assert.Equal(4, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + Assert.Equal("CMT", df.Columns["Column0"][3]); + VerifyColumnTypes(df); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data), header: false); + RegularTest(df); + DataFrame csvDf = DataFrame.LoadCsvFromString(data, header: false); + RegularTest(csvDf); + + void ReducedRowsTest(DataFrame reducedRows) + { + Assert.Equal(3, reducedRows.Rows.Count); + Assert.Equal(7, reducedRows.Columns.Count); + Assert.Equal("CMT", reducedRows.Columns["Column0"][2]); + VerifyColumnTypes(df); + } + + DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), header: false, numberOfRowsToRead: 3); + ReducedRowsTest(reducedRows); + csvDf = DataFrame.LoadCsvFromString(data, header: false, numberOfRowsToRead: 3); + ReducedRowsTest(csvDf); + } + + void VerifyDataFrameWithNamedColumnsAndDataTypes(DataFrame df, bool verifyColumnDataType, bool verifyNames) + { + Assert.Equal(4, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + + if (verifyColumnDataType) + { + Assert.True(typeof(string) == df.Columns[0].DataType); + Assert.True(typeof(short) == df.Columns[1].DataType); + Assert.True(typeof(int) == df.Columns[2].DataType); + Assert.True(typeof(long) == df.Columns[3].DataType); + Assert.True(typeof(float) == df.Columns[4].DataType); + Assert.True(typeof(string) == df.Columns[5].DataType); + Assert.True(typeof(double) == df.Columns[6].DataType); + } + + if (verifyNames) + { + Assert.Equal("vendor_id", df.Columns[0].Name); + Assert.Equal("rate_code", df.Columns[1].Name); + Assert.Equal("passenger_count", df.Columns[2].Name); + Assert.Equal("trip_time_in_secs", df.Columns[3].Name); + Assert.Equal("trip_distance", df.Columns[4].Name); + Assert.Equal("payment_type", df.Columns[5].Name); + Assert.Equal("fare_amount", df.Columns[6].Name); + } + + VerifyColumnTypes(df); + + foreach (var column in df.Columns) + { + Assert.Equal(0, column.NullCount); + } + } + + [Theory] + [InlineData(true, 0)] + [InlineData(false, 0)] + [InlineData(true, 10)] + [InlineData(false, 10)] + public void TestReadCsvWithTypesAndGuessRows(bool header, int guessRows) + { + /* Tests this matrix + * + header GuessRows DataTypes + True 0 NotNull + False 0 NotNull + True 10 NotNull + False 10 NotNull + True 0 Null -----> Throws an exception + False 0 Null -----> Throws an exception + True 10 Null + False 10 Null + * + */ + string headerLine = @"vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount +"; + string dataLines = +@"CMT,1,1,1271,3.8,CRD,17.5 +CMT,1,1,474,1.5,CRD,8 +CMT,1,1,637,1.4,CRD,8.5 +CMT,1,1,181,0.6,CSH,4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + string data = header ? headerLine + dataLines : dataLines; + DataFrame df = DataFrame.LoadCsv(GetStream(data), + header: header, + guessRows: guessRows, + dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) } + ); + VerifyDataFrameWithNamedColumnsAndDataTypes(df, verifyColumnDataType: true, verifyNames: header); + DataFrame csvDf = DataFrame.LoadCsvFromString(data, + header: header, + guessRows: guessRows, + dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) } + ); + VerifyDataFrameWithNamedColumnsAndDataTypes(csvDf, verifyColumnDataType: true, verifyNames: header); + + if (guessRows == 10) + { + df = DataFrame.LoadCsv(GetStream(data), + header: header, + guessRows: guessRows + ); + VerifyDataFrameWithNamedColumnsAndDataTypes(df, verifyColumnDataType: false, verifyNames: header); + csvDf = DataFrame.LoadCsvFromString(data, + header: header, + guessRows: guessRows); + VerifyDataFrameWithNamedColumnsAndDataTypes(csvDf, verifyColumnDataType: false, verifyNames: header); + } + else + { + Assert.ThrowsAny(() => DataFrame.LoadCsv(GetStream(data), + header: header, + guessRows: guessRows + )); + Assert.ThrowsAny(() => DataFrame.LoadCsvFromString(data, + header: header, + guessRows: guessRows + )); + } + } + + [Fact] + public void TestReadCsvWithTypes() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount +CMT,1,1,1271,3.8,CRD,17.5 +CMT,1,1,474,1.5,CRD,8 +CMT,1,1,637,1.4,CRD,8.5 +,,,,,, +CMT,1,1,181,0.6,CSH,4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + void Verify(DataFrame df) + { + Assert.Equal(5, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + + Assert.True(typeof(string) == df.Columns[0].DataType); + Assert.True(typeof(short) == df.Columns[1].DataType); + Assert.True(typeof(int) == df.Columns[2].DataType); + Assert.True(typeof(long) == df.Columns[3].DataType); + Assert.True(typeof(float) == df.Columns[4].DataType); + Assert.True(typeof(string) == df.Columns[5].DataType); + Assert.True(typeof(double) == df.Columns[6].DataType); + + Assert.Equal("vendor_id", df.Columns[0].Name); + Assert.Equal("rate_code", df.Columns[1].Name); + Assert.Equal("passenger_count", df.Columns[2].Name); + Assert.Equal("trip_time_in_secs", df.Columns[3].Name); + Assert.Equal("trip_distance", df.Columns[4].Name); + Assert.Equal("payment_type", df.Columns[5].Name); + Assert.Equal("fare_amount", df.Columns[6].Name); + VerifyColumnTypes(df); + + foreach (var column in df.Columns) + { + if (column.DataType != typeof(string)) + { + Assert.Equal(1, column.NullCount); + } + else + { + Assert.Equal(0, column.NullCount); + } + } + var nullRow = df.Rows[3]; + Assert.Equal("", nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + Assert.Null(nullRow[4]); + Assert.Equal("", nullRow[5]); + Assert.Null(nullRow[6]); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) }); + Verify(df); + df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long), typeof(float), typeof(string), typeof(double) }); + Verify(df); + } + + [Fact] + public void TestReadCsvWithPipeSeparator() + { + string data = @"vendor_id|rate_code|passenger_count|trip_time_in_secs|trip_distance|payment_type|fare_amount +CMT|1|1|1271|3.8|CRD|17.5 +CMT|1|1|474|1.5|CRD|8 +CMT|1|1|637|1.4|CRD|8.5 +|||||| +CMT|1|1|181|0.6|CSH|4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + void Verify(DataFrame df) + { + Assert.Equal(5, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + Assert.Equal("CMT", df.Columns["vendor_id"][4]); + VerifyColumnTypes(df); + + DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), separator: '|', numberOfRowsToRead: 3); + Assert.Equal(3, reducedRows.Rows.Count); + Assert.Equal(7, reducedRows.Columns.Count); + Assert.Equal("CMT", reducedRows.Columns["vendor_id"][2]); + VerifyColumnTypes(df); + + var nullRow = df.Rows[3]; + Assert.Equal("", nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + Assert.Null(nullRow[4]); + Assert.Equal("", nullRow[5]); + Assert.Null(nullRow[6]); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data), separator: '|'); + Verify(df); + df = DataFrame.LoadCsvFromString(data, separator: '|'); + Verify(df); + } + + [Fact] + public void TestReadCsvWithSemicolonSeparator() + { + string data = @"vendor_id;rate_code;passenger_count;trip_time_in_secs;trip_distance;payment_type;fare_amount +CMT;1;1;1271;3.8;CRD;17.5 +CMT;1;1;474;1.5;CRD;8 +CMT;1;1;637;1.4;CRD;8.5 +;;;;;; +CMT;1;1;181;0.6;CSH;4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + void Verify(DataFrame df) + { + Assert.Equal(5, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + Assert.Equal("CMT", df.Columns["vendor_id"][4]); + VerifyColumnTypes(df); + + DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), separator: ';', numberOfRowsToRead: 3); + Assert.Equal(3, reducedRows.Rows.Count); + Assert.Equal(7, reducedRows.Columns.Count); + Assert.Equal("CMT", reducedRows.Columns["vendor_id"][2]); + VerifyColumnTypes(df); + + var nullRow = df.Rows[3]; + Assert.Equal("", nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + Assert.Null(nullRow[4]); + Assert.Equal("", nullRow[5]); + Assert.Null(nullRow[6]); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data), separator: ';'); + Verify(df); + df = DataFrame.LoadCsvFromString(data, separator: ';'); + Verify(df); + } + + [Fact] + public void TestReadCsvWithExtraColumnInHeader() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount,extra +CMT,1,1,1271,3.8,CRD,17.5 +CMT,1,1,474,1.5,CRD,8 +CMT,1,1,637,1.4,CRD,8.5 +CMT,1,1,181,0.6,CSH,4.5"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + void Verify(DataFrame df) + { + Assert.Equal(4, df.Rows.Count); + Assert.Equal(7, df.Columns.Count); + Assert.Equal("CMT", df.Columns["vendor_id"][3]); + VerifyColumnTypes(df); + + DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), numberOfRowsToRead: 3); + Assert.Equal(3, reducedRows.Rows.Count); + Assert.Equal(7, reducedRows.Columns.Count); + Assert.Equal("CMT", reducedRows.Columns["vendor_id"][2]); + VerifyColumnTypes(df); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data)); + Verify(df); + df = DataFrame.LoadCsvFromString(data); + Verify(df); + } + + [Fact] + public void TestReadCsvWithExtraColumnInRow() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount +CMT,1,1,1271,3.8,CRD,17.5,0 +CMT,1,1,474,1.5,CRD,8,0 +CMT,1,1,637,1.4,CRD,8.5,0 +CMT,1,1,181,0.6,CSH,4.5,0"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + Assert.Throws(() => DataFrame.LoadCsv(GetStream(data))); + Assert.Throws(() => DataFrame.LoadCsvFromString(data)); + } + + [Fact] + public void TestReadCsvWithLessColumnsInRow() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs,trip_distance,payment_type,fare_amount +CMT,1,1,1271,3.8,CRD +CMT,1,1,474,1.5,CRD +CMT,1,1,637,1.4,CRD +CMT,1,1,181,0.6,CSH"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + void Verify(DataFrame df) + { + Assert.Equal(4, df.Rows.Count); + Assert.Equal(6, df.Columns.Count); + Assert.Equal("CMT", df.Columns["vendor_id"][3]); + VerifyColumnTypes(df); + + DataFrame reducedRows = DataFrame.LoadCsv(GetStream(data), numberOfRowsToRead: 3); + Assert.Equal(3, reducedRows.Rows.Count); + Assert.Equal(6, reducedRows.Columns.Count); + Assert.Equal("CMT", reducedRows.Columns["vendor_id"][2]); + VerifyColumnTypes(df); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data)); + Verify(df); + df = DataFrame.LoadCsvFromString(data); + Verify(df); + } + + [Fact] + public void TestReadCsvWithAllNulls() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs +null,null,null,null +Null,Null,Null,Null +null,null,null,null +Null,Null,Null,Null +null,null,null,null +null,null,null,null"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + void Verify(DataFrame df) + { + Assert.Equal(6, df.Rows.Count); + Assert.Equal(4, df.Columns.Count); + + Assert.True(typeof(string) == df.Columns[0].DataType); + Assert.True(typeof(string) == df.Columns[1].DataType); + Assert.True(typeof(string) == df.Columns[2].DataType); + Assert.True(typeof(string) == df.Columns[3].DataType); + + Assert.Equal("vendor_id", df.Columns[0].Name); + Assert.Equal("rate_code", df.Columns[1].Name); + Assert.Equal("passenger_count", df.Columns[2].Name); + Assert.Equal("trip_time_in_secs", df.Columns[3].Name); + VerifyColumnTypes(df); + + foreach (var column in df.Columns) + { + Assert.Equal(6, column.NullCount); + foreach (var value in column) + { + Assert.Null(value); + } + } + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data)); + Verify(df); + df = DataFrame.LoadCsvFromString(data); + Verify(df); + } + + [Fact] + public void TestReadCsvWithNullsAndDataTypes() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs +null,1,1,1271 +CMT,Null,1,474 +CMT,1,null,637 +Null,,, +,,, +CMT,1,1,null"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + void Verify(DataFrame df) + { + Assert.Equal(6, df.Rows.Count); + Assert.Equal(4, df.Columns.Count); + + Assert.True(typeof(string) == df.Columns[0].DataType); + Assert.True(typeof(short) == df.Columns[1].DataType); + Assert.True(typeof(int) == df.Columns[2].DataType); + Assert.True(typeof(long) == df.Columns[3].DataType); + + Assert.Equal("vendor_id", df.Columns[0].Name); + Assert.Equal("rate_code", df.Columns[1].Name); + Assert.Equal("passenger_count", df.Columns[2].Name); + Assert.Equal("trip_time_in_secs", df.Columns[3].Name); + VerifyColumnTypes(df); + + foreach (var column in df.Columns) + { + if (column.DataType != typeof(string)) + { + Assert.Equal(3, column.NullCount); + } + else + { + Assert.Equal(2, column.NullCount); + } + } + var nullRow = df.Rows[3]; + Assert.Null(nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + + nullRow = df.Rows[4]; + Assert.Equal("", nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + + Assert.Null(df[0, 0]); + Assert.Null(df[1, 1]); + Assert.Null(df[2, 2]); + Assert.Null(df[5, 3]); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data), dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long) }); + Verify(df); + df = DataFrame.LoadCsvFromString(data, dataTypes: new Type[] { typeof(string), typeof(short), typeof(int), typeof(long) }); + Verify(df); + } + + [Fact] + public void TestReadCsvWithNulls() + { + string data = @"vendor_id,rate_code,passenger_count,trip_time_in_secs +null,1,1,1271 +CMT,Null,1,474 +CMT,1,null,637 +Null,,, +,,, +CMT,1,1,null"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + void Verify(DataFrame df) + { + Assert.Equal(6, df.Rows.Count); + Assert.Equal(4, df.Columns.Count); + + Assert.True(typeof(string) == df.Columns[0].DataType); + Assert.True(typeof(float) == df.Columns[1].DataType); + Assert.True(typeof(float) == df.Columns[2].DataType); + Assert.True(typeof(float) == df.Columns[3].DataType); + + Assert.Equal("vendor_id", df.Columns[0].Name); + Assert.Equal("rate_code", df.Columns[1].Name); + Assert.Equal("passenger_count", df.Columns[2].Name); + Assert.Equal("trip_time_in_secs", df.Columns[3].Name); + VerifyColumnTypes(df); + + foreach (var column in df.Columns) + { + if (column.DataType != typeof(string)) + { + Assert.Equal(3, column.NullCount); + } + else + { + Assert.Equal(2, column.NullCount); + } + } + var nullRow = df.Rows[3]; + Assert.Null(nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + + nullRow = df.Rows[4]; + Assert.Equal("", nullRow[0]); + Assert.Null(nullRow[1]); + Assert.Null(nullRow[2]); + Assert.Null(nullRow[3]); + + Assert.Null(df[0, 0]); + Assert.Null(df[1, 1]); + Assert.Null(df[2, 2]); + Assert.Null(df[5, 3]); + } + + DataFrame df = DataFrame.LoadCsv(GetStream(data)); + Verify(df); + df = DataFrame.LoadCsvFromString(data); + Verify(df); + } + + [Fact] + public void TestWriteCsvWithHeader() + { + using MemoryStream csvStream = new MemoryStream(); + DataFrame dataFrame = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, true); + + DataFrame.WriteCsv(dataFrame, csvStream); + + csvStream.Seek(0, SeekOrigin.Begin); + DataFrame readIn = DataFrame.LoadCsv(csvStream); + + Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); + Assert.Equal(dataFrame.Columns.Count, readIn.Columns.Count); + Assert.Equal(1F, readIn[1, 0]); + Assert.Equal(1F, readIn[1, 1]); + Assert.Equal(1F, readIn[1, 2]); + Assert.Equal(1F, readIn[1, 3]); + Assert.Equal(1F, readIn[1, 4]); + Assert.Equal(1F, readIn[1, 5]); + Assert.Equal(1F, readIn[1, 6]); + Assert.Equal(1F, readIn[1, 7]); + Assert.Equal(1F, readIn[1, 8]); + Assert.Equal(1F, readIn[1, 9]); + Assert.Equal(1F, readIn[1, 10]); + } + + [Fact] + public void TestWriteCsvWithCultureInfoRomanianAndSemiColon() + { + DataFrame dataFrame = DataFrameTests.MakeDataFrameWithNumericColumns(10, true); + dataFrame[1, 1] = 1.1M; + dataFrame[1, 2] = 1.2D; + dataFrame[1, 3] = 1.3F; + + using MemoryStream csvStream = new MemoryStream(); + var cultureInfo = new CultureInfo("ro-RO"); + var separator = ';'; + DataFrame.WriteCsv(dataFrame, csvStream, separator: separator, cultureInfo: cultureInfo); + + csvStream.Seek(0, SeekOrigin.Begin); + DataFrame readIn = DataFrame.LoadCsv(csvStream, separator: separator); + + Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); + Assert.Equal(dataFrame.Columns.Count, readIn.Columns.Count); + Assert.Equal(1F, readIn[1, 0]); + + // LoadCsv does not support culture info, therefore decimal point comma (,) is seen as thousand separator and is ignored when read + Assert.Equal(11F, readIn[1, 1]); + Assert.Equal(12F, readIn[1, 2]); + Assert.Equal(129999992F, readIn[1, 3]); + + Assert.Equal(1F, readIn[1, 4]); + Assert.Equal(1F, readIn[1, 5]); + Assert.Equal(1F, readIn[1, 6]); + Assert.Equal(1F, readIn[1, 7]); + Assert.Equal(1F, readIn[1, 8]); + Assert.Equal(1F, readIn[1, 9]); + Assert.Equal(1F, readIn[1, 10]); + } + + [Fact] + public void TestWriteCsvWithCultureInfo() + { + using MemoryStream csvStream = new MemoryStream(); + DataFrame dataFrame = DataFrameTests.MakeDataFrameWithNumericColumns(10, true); + dataFrame[1, 1] = 1.1M; + dataFrame[1, 2] = 1.2D; + dataFrame[1, 3] = 1.3F; + + var cultureInfo = new CultureInfo("en-US"); + DataFrame.WriteCsv(dataFrame, csvStream, cultureInfo: cultureInfo); + + csvStream.Seek(0, SeekOrigin.Begin); + DataFrame readIn = DataFrame.LoadCsv(csvStream); + + Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); + Assert.Equal(dataFrame.Columns.Count, readIn.Columns.Count); + Assert.Equal(1F, readIn[1, 0]); + Assert.Equal(1.1F, readIn[1, 1]); + Assert.Equal(1.2F, readIn[1, 2]); + Assert.Equal(1.3F, readIn[1, 3]); + Assert.Equal(1F, readIn[1, 4]); + Assert.Equal(1F, readIn[1, 5]); + Assert.Equal(1F, readIn[1, 6]); + Assert.Equal(1F, readIn[1, 7]); + Assert.Equal(1F, readIn[1, 8]); + Assert.Equal(1F, readIn[1, 9]); + Assert.Equal(1F, readIn[1, 10]); + } + + [Fact] + public void TestWriteCsvWithCultureInfoRomanianAndComma() + { + using MemoryStream csvStream = new MemoryStream(); + DataFrame dataFrame = DataFrameTests.MakeDataFrameWithNumericColumns(10, true); + + var cultureInfo = new CultureInfo("ro-RO"); + var separator = cultureInfo.NumberFormat.NumberDecimalSeparator.First(); + + Assert.Throws(() => DataFrame.WriteCsv(dataFrame, csvStream, separator: separator, cultureInfo: cultureInfo)); + } + + [Fact] + public void TestWriteCsvWithNoHeader() + { + using MemoryStream csvStream = new MemoryStream(); + DataFrame dataFrame = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, true); + + DataFrame.WriteCsv(dataFrame, csvStream, header: false); + + csvStream.Seek(0, SeekOrigin.Begin); + DataFrame readIn = DataFrame.LoadCsv(csvStream, header: false); + + Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); + Assert.Equal(dataFrame.Columns.Count, readIn.Columns.Count); + Assert.Equal(1F, readIn[1, 0]); + Assert.Equal(1F, readIn[1, 1]); + Assert.Equal(1F, readIn[1, 2]); + Assert.Equal(1F, readIn[1, 3]); + Assert.Equal(1F, readIn[1, 4]); + Assert.Equal(1F, readIn[1, 5]); + Assert.Equal(1F, readIn[1, 6]); + Assert.Equal(1F, readIn[1, 7]); + Assert.Equal(1F, readIn[1, 8]); + Assert.Equal(1F, readIn[1, 9]); + Assert.Equal(1F, readIn[1, 10]); + } + + [Fact] + public void TestWriteCsvWithSemicolonSeparator() + { + using MemoryStream csvStream = new MemoryStream(); + DataFrame dataFrame = DataFrameTests.MakeDataFrameWithAllColumnTypes(10, true); + + var separator = ';'; + DataFrame.WriteCsv(dataFrame, csvStream, separator: separator); + + csvStream.Seek(0, SeekOrigin.Begin); + DataFrame readIn = DataFrame.LoadCsv(csvStream, separator: separator); + + Assert.Equal(dataFrame.Rows.Count, readIn.Rows.Count); + Assert.Equal(dataFrame.Columns.Count, readIn.Columns.Count); + Assert.Equal(1F, readIn[1, 0]); + Assert.Equal(1F, readIn[1, 1]); + Assert.Equal(1F, readIn[1, 2]); + Assert.Equal(1F, readIn[1, 3]); + Assert.Equal(1F, readIn[1, 4]); + Assert.Equal(1F, readIn[1, 5]); + Assert.Equal(1F, readIn[1, 6]); + Assert.Equal(1F, readIn[1, 7]); + Assert.Equal(1F, readIn[1, 8]); + Assert.Equal(1F, readIn[1, 9]); + Assert.Equal(1F, readIn[1, 10]); + } + + [Fact] + public void TestMixedDataTypesInCsv() + { + string data = @"vendor_id,empty +null, +1, +true, +Null, +, +CMT,"; + + Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + DataFrame df = DataFrame.LoadCsv(GetStream(data)); + Assert.Equal(6, df.Rows.Count); + Assert.Equal(2, df.Columns.Count); + + Assert.True(typeof(string) == df.Columns[0].DataType); + Assert.True(typeof(string) == df.Columns[1].DataType); + + Assert.Equal("vendor_id", df.Columns[0].Name); + Assert.Equal("empty", df.Columns[1].Name); + VerifyColumnTypes(df); + Assert.Equal(2, df.Columns[0].NullCount); + Assert.Equal(0, df.Columns[1].NullCount); + + var nullRow = df.Rows[3]; + Assert.Null(nullRow[0]); + + nullRow = df.Rows[4]; + Assert.Equal("", nullRow[0]); + + Assert.Null(df[0, 0]); + Assert.Null(df[3, 0]); + + StringDataFrameColumn emptyColumn = (StringDataFrameColumn)df.Columns[1]; + for (long i = 0; i < emptyColumn.Length; i++) + { + Assert.Equal("", emptyColumn[i]); + } + } + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/DataFrameColumn.BinaryOperationTests.cs b/test/Microsoft.Data.Analysis.Tests/DataFrameColumn.BinaryOperationTests.cs new file mode 100644 index 0000000000..03854c7c5e --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/DataFrameColumn.BinaryOperationTests.cs @@ -0,0 +1,2648 @@ + + +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperationTests.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public partial class DataFrameColumnTests + { + [Fact] + public void AddByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddDecimalDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + DecimalDataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)(2 * x)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddDoubleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + DoubleDataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (double)(2 * x)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddSingleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + SingleDataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (float)(2 * x)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + Int64DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (long)(2 * x)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddSByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddUInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + UInt32DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (uint)(2 * x)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddUInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + UInt64DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)(2 * x)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddUInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column + otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(2 * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x + (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x + (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x + (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x + (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x + (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x + (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void AddUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = column + value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x + (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x + (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x + (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x + (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x + (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x + (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseAddUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = value + column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x + (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)0); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractDecimalDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + DecimalDataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)0); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractDoubleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + DoubleDataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (double)0); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractSingleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + SingleDataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (float)0); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)0); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + Int64DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (long)0); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractSByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)0); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)0); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractUInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + UInt32DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (uint)0); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractUInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + UInt64DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)0); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractUInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column - otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)0); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x - (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x - (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x - (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x - (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x - (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x - (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void SubtractUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = column - value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x - (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)value - (decimal)x)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)value - (double)x)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)value - (float)x)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)value - (long)x)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)value - (uint)x)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)value - (ulong)x)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseSubtractUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = value - column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value - (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyDecimalDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + DecimalDataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)(x * x)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyDoubleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + DoubleDataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (double)(x * x)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplySingleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + SingleDataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (float)(x * x)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + Int64DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (long)(x * x)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplySByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyUInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + UInt32DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (uint)(x * x)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyUInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + UInt64DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)(x * x)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyUInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column * otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(x * x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x * (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x * (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplySingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x * (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x * (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplySByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x * (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x * (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void MultiplyUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = column * value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x * (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x * (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplySingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x * (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x * (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplySByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x * (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x * (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseMultiplyUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = value * column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x * (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideDecimalDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + DecimalDataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)(1)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideDoubleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + DoubleDataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (double)(1)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideSingleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + SingleDataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (float)(1)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + Int64DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (long)(1)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideSByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideUInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + UInt32DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (uint)(1)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideUInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + UInt64DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)(1)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideUInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column / otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(1)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x / (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x / (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x / (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x / (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x / (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x / (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void DivideUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = column / value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x / (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)value / (decimal)x)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)value / (double)x)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)value / (float)x)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)value / (long)x)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)value / (uint)x)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)value / (ulong)x)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseDivideUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = value / column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value / (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloDecimalDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + DecimalDataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)(0)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloDoubleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + DoubleDataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (double)(0)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloSingleDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + SingleDataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (float)(0)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + Int64DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (long)(0)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloSByteDataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloUInt32DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + UInt32DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (uint)(0)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloUInt64DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + UInt64DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)(0)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloUInt16DataFrameColumnToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + Int32DataFrameColumn columnResult = column % otherColumn; + var verify = Enumerable.Range(1, 10).Select(x => (int)(0)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)x % (decimal)value)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)x % (double)value)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)x % (float)value)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)x % (long)value)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)x % (uint)value)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)x % (ulong)value)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ModuloUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = column % value; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)x % (int)value)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 5; + Int32DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloDecimalToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 5; + DecimalDataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (decimal)((decimal)value % (decimal)x)); + var verifyColumn = new DecimalDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloDoubleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 5; + DoubleDataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (double)((double)value % (double)x)); + var verifyColumn = new DoubleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloSingleToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 5; + SingleDataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (float)((float)value % (float)x)); + var verifyColumn = new SingleDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 5; + Int32DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 5; + Int64DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (long)((long)value % (long)x)); + var verifyColumn = new Int64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloSByteToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 5; + Int32DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 5; + Int32DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloUInt32ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 5; + UInt32DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (uint)((uint)value % (uint)x)); + var verifyColumn = new UInt32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloUInt64ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 5; + UInt64DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (ulong)((ulong)value % (ulong)x)); + var verifyColumn = new UInt64DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ReverseModuloUInt16ToByteDataFrameColumn() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 5; + Int32DataFrameColumn columnResult = value % column; + var verify = Enumerable.Range(1, 10).Select(x => (int)((int)value % (int)x)); + var verifyColumn = new Int32DataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToDecimal() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToDouble() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToSingle() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToSByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToUInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToUInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToUInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarDecimal() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarDouble() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarSingle() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarSByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarUInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarUInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseEqualsBooleanToScalarUInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn otherColumn = new ByteDataFrameColumn("Byte", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToDecimal() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (decimal)x); + DecimalDataFrameColumn otherColumn = new DecimalDataFrameColumn("Decimal", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToDouble() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (double)x); + DoubleDataFrameColumn otherColumn = new DoubleDataFrameColumn("Double", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToSingle() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (float)x); + SingleDataFrameColumn otherColumn = new SingleDataFrameColumn("Single", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (int)x); + Int32DataFrameColumn otherColumn = new Int32DataFrameColumn("Int32", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (long)x); + Int64DataFrameColumn otherColumn = new Int64DataFrameColumn("Int64", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToSByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (sbyte)x); + SByteDataFrameColumn otherColumn = new SByteDataFrameColumn("SByte", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (short)x); + Int16DataFrameColumn otherColumn = new Int16DataFrameColumn("Int16", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToUInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (uint)x); + UInt32DataFrameColumn otherColumn = new UInt32DataFrameColumn("UInt32", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToUInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ulong)x); + UInt64DataFrameColumn otherColumn = new UInt64DataFrameColumn("UInt64", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToUInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (ushort)x); + UInt16DataFrameColumn otherColumn = new UInt16DataFrameColumn("UInt16", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(otherColumn); + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + byte value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarDecimal() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + decimal value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarDouble() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + double value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarSingle() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + float value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + int value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + long value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarSByte() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + sbyte value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + short value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarUInt32() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + uint value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarUInt64() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ulong value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + [Fact] + public void ElementwiseNotEqualsBooleanToScalarUInt16() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (byte)x); + ByteDataFrameColumn column = new ByteDataFrameColumn("Byte", columnEnumerable); + ushort value = 100; + BooleanDataFrameColumn columnResult = column.ElementwiseNotEquals(value); + var verify = Enumerable.Range(1, 10).Select(x => (bool)(false)); + var verifyColumn = new BooleanDataFrameColumn("Verify", verify); + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); + } + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/DataFrameColumn.BinaryOperationTests.tt b/test/Microsoft.Data.Analysis.Tests/DataFrameColumn.BinaryOperationTests.tt new file mode 100644 index 0000000000..08597cc83b --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/DataFrameColumn.BinaryOperationTests.tt @@ -0,0 +1,626 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".cs" #> +<#@ include file="..\..\src\Microsoft.Data.Analysis\ColumnArithmeticTemplate.ttinclude"#> +<#@ include file="..\..\src\Microsoft.Data.Analysis\PrimitiveDataFrameColumn.BinaryOperations.Combinations.ttinclude" #> +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +// Generated from DataFrameColumn.BinaryOperationTests.tt. Do not modify directly + +using System; +using System.Collections.Generic; +using System.Linq; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public partial class DataFrameColumnTests + { +<# +bool supportedInPlace(string type1, string type2) +{ + primitiveTypeToPrimitivityLevelMap.TryGetValue(type1, out int columnTypeLevel); + primitiveTypeToPrimitivityLevelMap.TryGetValue(type2, out int otherColumnTypeLevel); + if (columnTypeLevel < otherColumnTypeLevel) + { + return false; + } + return true; +} +#> +<# +void GenerateBinaryVerify(string methodName, string fullReturnType, string returnType) +{ +#> +<# + if (methodName == "Add") + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(2 * x)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName == "Subtract") + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)0); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName == "Multiply") + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(x * x)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName == "Divide") + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(1)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName == "Modulo") + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(0)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } +#> +<# +} +#> +<# +// Only generate the tests for ByteDataFrameColumn. It exercises all the possible paths since it includes cloning the non byte columns and keeps the number of tests low enough. +void GenerateAllBinaryTestsForMethod(string methodName, string methodOperator) +{ + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + if (columnType != "byte") + { + continue; + } + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); +#> + [Fact] + public void <#=methodName#><#=fullOtherColumnType#>To<#=fullColumnType#>() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=columnType#>)x); + <#=fullColumnType#> column = new <#=fullColumnType#>("<#=capitalizedColumnType#>", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=otherColumnType#>)x); + <#=fullOtherColumnType#> otherColumn = new <#=fullOtherColumnType#>("<#=capitalizedOtherColumnType#>", otherColumnEnumerable); + <#=fullReturnType#> columnResult = column <#=methodOperator#> otherColumn; +<#GenerateBinaryVerify(methodName, fullReturnType, returnType); #> + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } +<# +} +} +#> +<# +void GenerateBinaryScalarVerify(string methodName, string fullReturnType, string returnType, int value, bool isReverse) +{ + if (methodName.Contains("Add")) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x + (<#=returnType#>)value)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Subtract")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x - (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value - (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Multiply")) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x * (<#=returnType#>)value)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Divide")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x / (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value / (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Modulo")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x % (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value % (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } +#> +<# +} +#> +<# +void GenerateBinaryComparisonScalarVerify(string methodName, string fullReturnType, string returnType, int value, bool isReverse) +{ + if (methodName.Contains("ElementwiseEquals")) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(false)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("ElementwiseNotEquals")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(false)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)(false)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Multiply")) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x * (<#=returnType#>)value)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Divide")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x / (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value / (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Modulo")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x % (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value % (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } +#> +<# +} +#> +<# +void GenerateBinaryComparisonVerify(string methodName, string fullReturnType, string returnType, int value, bool isReverse) +{ + if (methodName.Contains("ElementwiseEquals")) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => true); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("ElementwiseNotEquals")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => true); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => true); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Multiply")) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x * (<#=returnType#>)value)); + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Divide")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x / (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value / (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Modulo")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x % (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value % (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } +#> +<# +} +#> +<# +void GenerateBinaryBitwiseScalarVerify(string methodName, string fullReturnType, string returnType, bool value, bool isReverse) +{ + if (methodName.Contains("And")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x & (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value & (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Or")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x | (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value | (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } + else if (methodName.Contains("Xor")) + { + if (!isReverse) + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)x ^ (<#=returnType#>)value)); +<# + } + else + { +#> + var verify = Enumerable.Range(1, 10).Select(x => (<#=returnType#>)((<#=returnType#>)value ^ (<#=returnType#>)x)); +<# + } +#> + var verifyColumn = new <#=fullReturnType#>("Verify", verify); +<# + } +#> +<# +} +#> +<# +// Only generate the tests for ByteDataFrameColumn. It exercises all the possible paths since it includes cloning the non byte columns and keeps the number of tests low enough. +void GenerateAllBinaryScalarTestsForMethod(string methodName, string methodOperator) +{ + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + if (columnType != "byte") + { + continue; + } + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); +#> + [Fact] + public void <#=methodName#><#=capitalizedOtherColumnType#>To<#=fullColumnType#>() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=columnType#>)x); + <#=fullColumnType#> column = new <#=fullColumnType#>("<#=capitalizedColumnType#>", columnEnumerable); + <#=otherColumnType#> value = 5; +<# + if (methodName.Contains("Reverse")) + { +#> + <#=fullReturnType#> columnResult = value <#=methodOperator#> column; +<# + } + else + { +#> + <#=fullReturnType#> columnResult = column <#=methodOperator#> value; +<# + } +#> +<#GenerateBinaryScalarVerify(methodName, fullReturnType, returnType, (byte)5, methodName.Contains("Reverse") ? true : false); #> + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } +<# +} +} +#> +<# +// Only generate the tests for BooleanDataFrameColumn. +void GenerateAllBinaryScalarBitwiseTestsForMethod(string methodName, string methodOperator) +{ + foreach (TypeCombination types in BinaryOperationCombinations.binaryOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + if (columnType != "byte") + { + continue; + } + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); +#> + [Fact] + public void TestScalar<#=methodName#>On<#=fullColumnType#>() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=columnType#>)false); + <#=fullColumnType#> column = new <#=fullColumnType#>("<#=capitalizedColumnType#>", columnEnumerable); + <#=otherColumnType#> value = true; +<# + if (methodName.Contains("Reverse")) + { +#> + <#=fullReturnType#> columnResult = value <#=methodOperator#> column; +<# + } + else + { +#> + <#=fullReturnType#> columnResult = column <#=methodOperator#> value; +<# + } +#> +<#GenerateBinaryBitwiseScalarVerify(methodName, fullReturnType, returnType, true, methodName.Contains("Reverse") ? true : false); #> + Assert.Equal(columnResult.Length, verify.Count()); + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); + } +<# +} +} +#> +<# +// Only generate the tests for ByteDataFrameColumn. It exercises all the possible paths since it includes cloning the non byte columns and keeps the number of tests low enough. +void GenerateAllBinaryScalarComparisonTestsForMethod(string methodName, string methodOperator) +{ + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + if (columnType != "byte") + { + continue; + } + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); +#> + [Fact] + public void <#=methodName#><#=capitalizedReturnType#>ToScalar<#=capitalizedOtherColumnType#>() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=columnType#>)x); + <#=fullColumnType#> column = new <#=fullColumnType#>("<#=capitalizedColumnType#>", columnEnumerable); + <#=otherColumnType#> value = 100; + BooleanDataFrameColumn columnResult = column.<#=methodName#>(value); +<#GenerateBinaryComparisonScalarVerify(methodName, fullReturnType, returnType, (byte)5, methodName.Contains("Reverse") ? true : false); #> + Assert.Equal(columnResult.Length, verify.Count()); +<# if (!methodName.Contains("Not")) { #> + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); +<# } else { #> + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); +<# } #> + } +<# +} +} +#> +<# +// Only generate the tests for ByteDataFrameColumn. It exercises all the possible paths since it includes cloning the non byte columns and keeps the number of tests low enough. +void GenerateAllBinaryComparisonTestsForMethod(string methodName, string methodOperator) +{ + foreach (TypeCombination types in ComparisonOperationCombinations.comparisonOperationCombinations) +{ + string returnType = types.ReturnColumnType; + string columnType = types.ThisColumnType; + if (columnType != "byte") + { + continue; + } + string otherColumnType = types.OtherColumnType; + + string fullColumnType = GetCapitalizedPrimitiveTypes(columnType) + "DataFrameColumn"; + string fullReturnType = GetCapitalizedPrimitiveTypes(returnType) + "DataFrameColumn"; + string fullOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType) + "DataFrameColumn"; + + string capitalizedReturnType = GetCapitalizedPrimitiveTypes(returnType); + string capitalizedColumnType = GetCapitalizedPrimitiveTypes(columnType); + string capitalizedOtherColumnType = GetCapitalizedPrimitiveTypes(otherColumnType); +#> + [Fact] + public void <#=methodName#><#=capitalizedReturnType#>To<#=capitalizedOtherColumnType#>() + { + var columnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=columnType#>)x); + <#=fullColumnType#> column = new <#=fullColumnType#>("<#=capitalizedColumnType#>", columnEnumerable); + var otherColumnEnumerable = Enumerable.Range(1, 10).Select(x => (<#=otherColumnType#>)x); + <#=fullOtherColumnType#> otherColumn = new <#=fullOtherColumnType#>("<#=capitalizedOtherColumnType#>", otherColumnEnumerable); + BooleanDataFrameColumn columnResult = column.<#=methodName#>(otherColumn); +<#GenerateBinaryComparisonVerify(methodName, fullReturnType, returnType, (byte)5, methodName.Contains("Reverse") ? true : false); #> + Assert.Equal(columnResult.Length, verify.Count()); + + // If this is equals, change thisx to false +<# if (!methodName.Contains("Not")) { #> + Assert.True(columnResult.ElementwiseEquals(verifyColumn).All()); +<# } else { #> + Assert.True(columnResult.ElementwiseNotEquals(verifyColumn).All()); +<# } #> + } +<# +} +} +#> +<# + foreach (MethodConfiguration method in methodConfiguration) + { + if (method.MethodType == MethodType.Binary && method.IsNumeric) + { + GenerateAllBinaryTestsForMethod(method.MethodName, method.Operator); + } + else if (method.MethodType == MethodType.BinaryScalar && method.IsNumeric) + { + GenerateAllBinaryScalarTestsForMethod(method.MethodName, method.Operator); + GenerateAllBinaryScalarTestsForMethod("Reverse" + method.MethodName, method.Operator); + } + else if (method.MethodType == MethodType.ComparisonScalar) + { + // Test only the ElementwiseEquals and ElementwiseNotEquals methods to reduce the number of unit tests + if ((method.MethodName == "ElementwiseEquals") || (method.MethodName == "ElementwiseNotEquals")) + { + GenerateAllBinaryScalarComparisonTestsForMethod(method.MethodName, method.Operator); + } + } + else if (method.MethodType == MethodType.Comparison) + { + // Test only the ElementwiseEquals and ElementwiseNotEquals methods to reduce the number of unit tests + if ((method.MethodName == "ElementwiseEquals") || (method.MethodName == "ElementwiseNotEquals")) + { + GenerateAllBinaryComparisonTestsForMethod(method.MethodName, method.Operator); + } + } + /* + else if (method.MethodType == MethodType.BinaryScalar && method.IsBitwise) + { + GenerateAllBinaryScalarBitwiseTestsForMethod(method.MethodName, method.Operator); + } + */ + } +#> + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/DataFrameTests.IDataView.cs b/test/Microsoft.Data.Analysis.Tests/DataFrameTests.IDataView.cs new file mode 100644 index 0000000000..9ed4963b7f --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/DataFrameTests.IDataView.cs @@ -0,0 +1,228 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Linq; +using Microsoft.ML; +using Microsoft.ML.Data; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public partial class DataFrameTests + { + [Fact] + public void TestIDataView() + { + IDataView dataView = MakeDataFrameWithAllColumnTypes(10, withNulls: false); + + DataDebuggerPreview preview = dataView.Preview(); + Assert.Equal(10, preview.RowView.Length); + Assert.Equal(15, preview.ColumnView.Length); + + Assert.Equal("Byte", preview.ColumnView[0].Column.Name); + Assert.Equal((byte)0, preview.ColumnView[0].Values[0]); + Assert.Equal((byte)1, preview.ColumnView[0].Values[1]); + + Assert.Equal("Decimal", preview.ColumnView[1].Column.Name); + Assert.Equal((double)0, preview.ColumnView[1].Values[0]); + Assert.Equal((double)1, preview.ColumnView[1].Values[1]); + + Assert.Equal("Double", preview.ColumnView[2].Column.Name); + Assert.Equal((double)0, preview.ColumnView[2].Values[0]); + Assert.Equal((double)1, preview.ColumnView[2].Values[1]); + + Assert.Equal("Float", preview.ColumnView[3].Column.Name); + Assert.Equal((float)0, preview.ColumnView[3].Values[0]); + Assert.Equal((float)1, preview.ColumnView[3].Values[1]); + + Assert.Equal("Int", preview.ColumnView[4].Column.Name); + Assert.Equal((int)0, preview.ColumnView[4].Values[0]); + Assert.Equal((int)1, preview.ColumnView[4].Values[1]); + + Assert.Equal("Long", preview.ColumnView[5].Column.Name); + Assert.Equal((long)0, preview.ColumnView[5].Values[0]); + Assert.Equal((long)1, preview.ColumnView[5].Values[1]); + + Assert.Equal("Sbyte", preview.ColumnView[6].Column.Name); + Assert.Equal((sbyte)0, preview.ColumnView[6].Values[0]); + Assert.Equal((sbyte)1, preview.ColumnView[6].Values[1]); + + Assert.Equal("Short", preview.ColumnView[7].Column.Name); + Assert.Equal((short)0, preview.ColumnView[7].Values[0]); + Assert.Equal((short)1, preview.ColumnView[7].Values[1]); + + Assert.Equal("Uint", preview.ColumnView[8].Column.Name); + Assert.Equal((uint)0, preview.ColumnView[8].Values[0]); + Assert.Equal((uint)1, preview.ColumnView[8].Values[1]); + + Assert.Equal("Ulong", preview.ColumnView[9].Column.Name); + Assert.Equal((ulong)0, preview.ColumnView[9].Values[0]); + Assert.Equal((ulong)1, preview.ColumnView[9].Values[1]); + + Assert.Equal("Ushort", preview.ColumnView[10].Column.Name); + Assert.Equal((ushort)0, preview.ColumnView[10].Values[0]); + Assert.Equal((ushort)1, preview.ColumnView[10].Values[1]); + + Assert.Equal("String", preview.ColumnView[11].Column.Name); + Assert.Equal("0".ToString(), preview.ColumnView[11].Values[0].ToString()); + Assert.Equal("1".ToString(), preview.ColumnView[11].Values[1].ToString()); + + Assert.Equal("Char", preview.ColumnView[12].Column.Name); + Assert.Equal((ushort)65, preview.ColumnView[12].Values[0]); + Assert.Equal((ushort)66, preview.ColumnView[12].Values[1]); + + Assert.Equal("Bool", preview.ColumnView[13].Column.Name); + Assert.Equal(true, preview.ColumnView[13].Values[0]); + Assert.Equal(false, preview.ColumnView[13].Values[1]); + + Assert.Equal("ArrowString", preview.ColumnView[14].Column.Name); + Assert.Equal("foo".ToString(), preview.ColumnView[14].Values[0].ToString()); + Assert.Equal("foo".ToString(), preview.ColumnView[14].Values[1].ToString()); + } + + [Fact] + public void TestIDataViewSchemaInvalidate() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10, withNulls: false); + + IDataView dataView = df; + + DataViewSchema schema = dataView.Schema; + Assert.Equal(14, schema.Count); + + df.Columns.Remove("Bool"); + schema = dataView.Schema; + Assert.Equal(13, schema.Count); + + DataFrameColumn boolColumn = new PrimitiveDataFrameColumn("Bool", Enumerable.Range(0, (int)df.Rows.Count).Select(x => x % 2 == 1)); + df.Columns.Insert(0, boolColumn); + schema = dataView.Schema; + Assert.Equal(14, schema.Count); + Assert.Equal("Bool", schema[0].Name); + + DataFrameColumn boolClone = boolColumn.Clone(); + boolClone.SetName("BoolClone"); + df.Columns[1] = boolClone; + schema = dataView.Schema; + Assert.Equal("BoolClone", schema[1].Name); + } + + [Fact] + public void TestIDataViewWithNulls() + { + int length = 10; + IDataView dataView = MakeDataFrameWithAllColumnTypes(length, withNulls: true); + + DataDebuggerPreview preview = dataView.Preview(); + Assert.Equal(length, preview.RowView.Length); + Assert.Equal(15, preview.ColumnView.Length); + + Assert.Equal("Byte", preview.ColumnView[0].Column.Name); + Assert.Equal((byte)0, preview.ColumnView[0].Values[0]); + Assert.Equal((byte)1, preview.ColumnView[0].Values[1]); + Assert.Equal((byte)4, preview.ColumnView[0].Values[4]); + Assert.Equal((byte)0, preview.ColumnView[0].Values[5]); // null row + Assert.Equal((byte)6, preview.ColumnView[0].Values[6]); + + Assert.Equal("Decimal", preview.ColumnView[1].Column.Name); + Assert.Equal((double)0, preview.ColumnView[1].Values[0]); + Assert.Equal((double)1, preview.ColumnView[1].Values[1]); + Assert.Equal((double)4, preview.ColumnView[1].Values[4]); + Assert.Equal(double.NaN, preview.ColumnView[1].Values[5]); // null row + Assert.Equal((double)6, preview.ColumnView[1].Values[6]); + + Assert.Equal("Double", preview.ColumnView[2].Column.Name); + Assert.Equal((double)0, preview.ColumnView[2].Values[0]); + Assert.Equal((double)1, preview.ColumnView[2].Values[1]); + Assert.Equal((double)4, preview.ColumnView[2].Values[4]); + Assert.Equal(double.NaN, preview.ColumnView[2].Values[5]); // null row + Assert.Equal((double)6, preview.ColumnView[2].Values[6]); + + Assert.Equal("Float", preview.ColumnView[3].Column.Name); + Assert.Equal((float)0, preview.ColumnView[3].Values[0]); + Assert.Equal((float)1, preview.ColumnView[3].Values[1]); + Assert.Equal((float)4, preview.ColumnView[3].Values[4]); + Assert.Equal(float.NaN, preview.ColumnView[3].Values[5]); // null row + Assert.Equal((float)6, preview.ColumnView[3].Values[6]); + + Assert.Equal("Int", preview.ColumnView[4].Column.Name); + Assert.Equal((int)0, preview.ColumnView[4].Values[0]); + Assert.Equal((int)1, preview.ColumnView[4].Values[1]); + Assert.Equal((int)4, preview.ColumnView[4].Values[4]); + Assert.Equal((int)0, preview.ColumnView[4].Values[5]); // null row + Assert.Equal((int)6, preview.ColumnView[4].Values[6]); + + Assert.Equal("Long", preview.ColumnView[5].Column.Name); + Assert.Equal((long)0, preview.ColumnView[5].Values[0]); + Assert.Equal((long)1, preview.ColumnView[5].Values[1]); + Assert.Equal((long)4, preview.ColumnView[5].Values[4]); + Assert.Equal((long)0, preview.ColumnView[5].Values[5]); // null row + Assert.Equal((long)6, preview.ColumnView[5].Values[6]); + + Assert.Equal("Sbyte", preview.ColumnView[6].Column.Name); + Assert.Equal((sbyte)0, preview.ColumnView[6].Values[0]); + Assert.Equal((sbyte)1, preview.ColumnView[6].Values[1]); + Assert.Equal((sbyte)4, preview.ColumnView[6].Values[4]); + Assert.Equal((sbyte)0, preview.ColumnView[6].Values[5]); // null row + Assert.Equal((sbyte)6, preview.ColumnView[6].Values[6]); + + Assert.Equal("Short", preview.ColumnView[7].Column.Name); + Assert.Equal((short)0, preview.ColumnView[7].Values[0]); + Assert.Equal((short)1, preview.ColumnView[7].Values[1]); + Assert.Equal((short)4, preview.ColumnView[7].Values[4]); + Assert.Equal((short)0, preview.ColumnView[7].Values[5]); // null row + Assert.Equal((short)6, preview.ColumnView[7].Values[6]); + + Assert.Equal("Uint", preview.ColumnView[8].Column.Name); + Assert.Equal((uint)0, preview.ColumnView[8].Values[0]); + Assert.Equal((uint)1, preview.ColumnView[8].Values[1]); + Assert.Equal((uint)4, preview.ColumnView[8].Values[4]); + Assert.Equal((uint)0, preview.ColumnView[8].Values[5]); // null row + Assert.Equal((uint)6, preview.ColumnView[8].Values[6]); + + Assert.Equal("Ulong", preview.ColumnView[9].Column.Name); + Assert.Equal((ulong)0, preview.ColumnView[9].Values[0]); + Assert.Equal((ulong)1, preview.ColumnView[9].Values[1]); + Assert.Equal((ulong)4, preview.ColumnView[9].Values[4]); + Assert.Equal((ulong)0, preview.ColumnView[9].Values[5]); // null row + Assert.Equal((ulong)6, preview.ColumnView[9].Values[6]); + + Assert.Equal("Ushort", preview.ColumnView[10].Column.Name); + Assert.Equal((ushort)0, preview.ColumnView[10].Values[0]); + Assert.Equal((ushort)1, preview.ColumnView[10].Values[1]); + Assert.Equal((ushort)4, preview.ColumnView[10].Values[4]); + Assert.Equal((ushort)0, preview.ColumnView[10].Values[5]); // null row + Assert.Equal((ushort)6, preview.ColumnView[10].Values[6]); + + Assert.Equal("String", preview.ColumnView[11].Column.Name); + Assert.Equal("0", preview.ColumnView[11].Values[0].ToString()); + Assert.Equal("1", preview.ColumnView[11].Values[1].ToString()); + Assert.Equal("4", preview.ColumnView[11].Values[4].ToString()); + Assert.Equal("", preview.ColumnView[11].Values[5].ToString()); // null row + Assert.Equal("6", preview.ColumnView[11].Values[6].ToString()); + + Assert.Equal("Char", preview.ColumnView[12].Column.Name); + Assert.Equal((ushort)65, preview.ColumnView[12].Values[0]); + Assert.Equal((ushort)66, preview.ColumnView[12].Values[1]); + Assert.Equal((ushort)69, preview.ColumnView[12].Values[4]); + Assert.Equal((ushort)0, preview.ColumnView[12].Values[5]); // null row + Assert.Equal((ushort)71, preview.ColumnView[12].Values[6]); + + Assert.Equal("Bool", preview.ColumnView[13].Column.Name); + Assert.Equal(true, preview.ColumnView[13].Values[0]); + Assert.Equal(false, preview.ColumnView[13].Values[1]); + Assert.Equal(true, preview.ColumnView[13].Values[4]); + Assert.Equal(false, preview.ColumnView[13].Values[5]); // null row + Assert.Equal(true, preview.ColumnView[13].Values[6]); + + Assert.Equal("ArrowString", preview.ColumnView[14].Column.Name); + Assert.Equal("foo", preview.ColumnView[14].Values[0].ToString()); + Assert.Equal("foo", preview.ColumnView[14].Values[1].ToString()); + Assert.Equal("foo", preview.ColumnView[14].Values[4].ToString()); + Assert.Equal("", preview.ColumnView[14].Values[5].ToString()); // null row + Assert.Equal("foo", preview.ColumnView[14].Values[6].ToString()); + } + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/DataFrameTests.cs b/test/Microsoft.Data.Analysis.Tests/DataFrameTests.cs new file mode 100644 index 0000000000..c277aae36e --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/DataFrameTests.cs @@ -0,0 +1,2324 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Apache.Arrow; +using Microsoft.ML; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public partial class DataFrameTests + { + public static DataFrame MakeDataFrameWithTwoColumns(int length, bool withNulls = true) + { + DataFrameColumn dataFrameColumn1 = new Int32DataFrameColumn("Int1", Enumerable.Range(0, length).Select(x => x)); + DataFrameColumn dataFrameColumn2 = new Int32DataFrameColumn("Int2", Enumerable.Range(10, length).Select(x => x)); + if (withNulls) + { + dataFrameColumn1[length / 2] = null; + dataFrameColumn2[length / 2] = null; + } + DataFrame dataFrame = new DataFrame(); + dataFrame.Columns.Insert(0, dataFrameColumn1); + dataFrame.Columns.Insert(1, dataFrameColumn2); + return dataFrame; + } + + public static ArrowStringDataFrameColumn CreateArrowStringColumn(int length, bool withNulls = true) + { + byte[] dataMemory = new byte[length * 3]; + byte[] nullMemory = new byte[BitUtility.ByteCount(length)]; + byte[] offsetMemory = new byte[(length + 1) * 4]; + + // Initialize offset with 0 as the first value + offsetMemory[0] = 0; + offsetMemory[1] = 0; + offsetMemory[2] = 0; + offsetMemory[3] = 0; + + // Append "foo" length times, with a possible `null` in the middle + int validStringsIndex = 0; + for (int i = 0; i < length; i++) + { + if (withNulls && i == length / 2) + { + BitUtility.SetBit(nullMemory, i, false); + } + else + { + int dataMemoryIndex = validStringsIndex * 3; + dataMemory[dataMemoryIndex++] = 102; + dataMemory[dataMemoryIndex++] = 111; + dataMemory[dataMemoryIndex++] = 111; + BitUtility.SetBit(nullMemory, i, true); + + validStringsIndex++; + } + + // write the current length to (index + 1) + int offsetIndex = (i + 1) * 4; + offsetMemory[offsetIndex++] = (byte)(3 * validStringsIndex); + offsetMemory[offsetIndex++] = 0; + offsetMemory[offsetIndex++] = 0; + offsetMemory[offsetIndex++] = 0; + } + + int nullCount = withNulls ? 1 : 0; + return new ArrowStringDataFrameColumn("ArrowString", dataMemory, offsetMemory, nullMemory, length, nullCount); + } + + public static DataFrame MakeDataFrameWithAllColumnTypes(int length, bool withNulls = true) + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(length, withNulls); + DataFrameColumn arrowStringColumn = CreateArrowStringColumn(length, withNulls); + df.Columns.Insert(df.Columns.Count, arrowStringColumn); + return df; + } + + public static DataFrame MakeDataFrameWithAllMutableColumnTypes(int length, bool withNulls = true) + { + DataFrame df = MakeDataFrameWithNumericAndStringColumns(length, withNulls); + DataFrameColumn boolColumn = new BooleanDataFrameColumn("Bool", Enumerable.Range(0, length).Select(x => x % 2 == 0)); + df.Columns.Insert(df.Columns.Count, boolColumn); + if (withNulls) + { + boolColumn[length / 2] = null; + } + return df; + } + + public static DataFrame MakeDataFrameWithNumericAndBoolColumns(int length, bool withNulls = true) + { + DataFrame df = MakeDataFrameWithNumericColumns(length, withNulls); + DataFrameColumn boolColumn = new BooleanDataFrameColumn("Bool", Enumerable.Range(0, length).Select(x => x % 2 == 0)); + df.Columns.Insert(df.Columns.Count, boolColumn); + if (withNulls) + { + boolColumn[length / 2] = null; + } + return df; + } + + public static DataFrame MakeDataFrameWithNumericAndStringColumns(int length, bool withNulls = true) + { + DataFrame df = MakeDataFrameWithNumericColumns(length, withNulls); + DataFrameColumn stringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, length).Select(x => x.ToString())); + df.Columns.Insert(df.Columns.Count, stringColumn); + if (withNulls) + { + stringColumn[length / 2] = null; + } + + DataFrameColumn charColumn = new CharDataFrameColumn("Char", Enumerable.Range(0, length).Select(x => (char)(x + 65))); + df.Columns.Insert(df.Columns.Count, charColumn); + if (withNulls) + { + charColumn[length / 2] = null; + } + return df; + } + + public static DataFrame MakeDataFrameWithNumericColumns(int length, bool withNulls = true) + { + DataFrameColumn byteColumn = new ByteDataFrameColumn("Byte", Enumerable.Range(0, length).Select(x => (byte)x)); + DataFrameColumn decimalColumn = new DecimalDataFrameColumn("Decimal", Enumerable.Range(0, length).Select(x => (decimal)x)); + DataFrameColumn doubleColumn = new DoubleDataFrameColumn("Double", Enumerable.Range(0, length).Select(x => (double)x)); + DataFrameColumn floatColumn = new SingleDataFrameColumn("Float", Enumerable.Range(0, length).Select(x => (float)x)); + DataFrameColumn intColumn = new Int32DataFrameColumn("Int", Enumerable.Range(0, length).Select(x => x)); + DataFrameColumn longColumn = new Int64DataFrameColumn("Long", Enumerable.Range(0, length).Select(x => (long)x)); + DataFrameColumn sbyteColumn = new SByteDataFrameColumn("Sbyte", Enumerable.Range(0, length).Select(x => (sbyte)x)); + DataFrameColumn shortColumn = new Int16DataFrameColumn("Short", Enumerable.Range(0, length).Select(x => (short)x)); + DataFrameColumn uintColumn = new UInt32DataFrameColumn("Uint", Enumerable.Range(0, length).Select(x => (uint)x)); + DataFrameColumn ulongColumn = new UInt64DataFrameColumn("Ulong", Enumerable.Range(0, length).Select(x => (ulong)x)); + DataFrameColumn ushortColumn = new UInt16DataFrameColumn("Ushort", Enumerable.Range(0, length).Select(x => (ushort)x)); + + DataFrame dataFrame = new DataFrame(new List { byteColumn, decimalColumn, doubleColumn, floatColumn, intColumn, longColumn, sbyteColumn, shortColumn, uintColumn, ulongColumn, ushortColumn }); + + if (withNulls) + { + for (int i = 0; i < dataFrame.Columns.Count; i++) + { + dataFrame.Columns[i][length / 2] = null; + } + } + return dataFrame; + } + + public static DataFrame MakeDataFrame(int length, bool withNulls = true) + where T1 : unmanaged + where T2 : unmanaged + { + DataFrameColumn baseColumn1 = DataFrameColumn.Create("Column1", Enumerable.Range(0, length).Select(x => (T1)Convert.ChangeType(x % 2 == 0 ? 0 : 1, typeof(T1)))); + DataFrameColumn baseColumn2 = DataFrameColumn.Create("Column2", Enumerable.Range(0, length).Select(x => (T2)Convert.ChangeType(x % 2 == 0 ? 0 : 1, typeof(T2)))); + DataFrame dataFrame = new DataFrame(new List { baseColumn1, baseColumn2 }); + + if (withNulls) + { + for (int i = 0; i < dataFrame.Columns.Count; i++) + { + dataFrame.Columns[i][length / 2] = null; + } + } + + return dataFrame; + } + + public DataFrame SplitTrainTest(DataFrame input, float testRatio, out DataFrame Test) + { + IEnumerable randomIndices = Enumerable.Range(0, (int)input.Rows.Count); + IEnumerable trainIndices = randomIndices.Take((int)(input.Rows.Count * testRatio)); + IEnumerable testIndices = randomIndices.Skip((int)(input.Rows.Count * testRatio)); + Test = input[testIndices]; + return input[trainIndices]; + } + + + [Fact] + public void TestIndexer() + { + DataFrame dataFrame = MakeDataFrameWithTwoColumns(length: 10); + var foo = dataFrame[0, 0]; + Assert.Equal(0, dataFrame[0, 0]); + Assert.Equal(11, dataFrame[1, 1]); + Assert.Equal(2, dataFrame.Columns.Count); + Assert.Equal("Int1", dataFrame.Columns[0].Name); + + var headList = dataFrame.Head(5); + Assert.Equal(14, (int)headList.Rows[4][1]); + + var tailList = dataFrame.Tail(5); + Assert.Equal(19, (int)tailList.Rows[4][1]); + + dataFrame[2, 1] = 1000; + Assert.Equal(1000, dataFrame[2, 1]); + + var row = dataFrame.Rows[4]; + Assert.Equal(14, (int)row[1]); + + var column = dataFrame["Int2"] as Int32DataFrameColumn; + Assert.Equal(1000, (int)column[2]); + + Assert.Throws(() => dataFrame["Int5"]); + Assert.Throws(() => dataFrame[(string)null]); + } + + [Fact] + public void ColumnAndTableCreationTest() + { + DataFrameColumn intColumn = new Int32DataFrameColumn("IntColumn", Enumerable.Range(0, 10).Select(x => x)); + DataFrameColumn floatColumn = new SingleDataFrameColumn("FloatColumn", Enumerable.Range(0, 10).Select(x => (float)x)); + DataFrame dataFrame = new DataFrame(); + dataFrame.Columns.Insert(0, intColumn); + dataFrame.Columns.Insert(1, floatColumn); + Assert.Equal(10, dataFrame.Rows.Count); + Assert.Equal(2, dataFrame.Columns.Count); + Assert.Equal(10, dataFrame.Columns[0].Length); + Assert.Equal("IntColumn", dataFrame.Columns[0].Name); + Assert.Equal(10, dataFrame.Columns[1].Length); + Assert.Equal("FloatColumn", dataFrame.Columns[1].Name); + + DataFrameColumn bigColumn = new SingleDataFrameColumn("BigColumn", Enumerable.Range(0, 11).Select(x => (float)x)); + DataFrameColumn repeatedName = new SingleDataFrameColumn("FloatColumn", Enumerable.Range(0, 10).Select(x => (float)x)); + Assert.Throws(() => dataFrame.Columns.Insert(2, bigColumn)); + Assert.Throws(() => dataFrame.Columns.Insert(2, repeatedName)); + Assert.Throws(() => dataFrame.Columns.Insert(10, repeatedName)); + + Assert.Equal(2, dataFrame.Columns.Count); + DataFrameColumn intColumnCopy = new Int32DataFrameColumn("IntColumn", Enumerable.Range(0, 10).Select(x => x)); + Assert.Throws(() => dataFrame.Columns[1] = intColumnCopy); + + DataFrameColumn differentIntColumn = new Int32DataFrameColumn("IntColumn1", Enumerable.Range(0, 10).Select(x => x)); + dataFrame.Columns[1] = differentIntColumn; + Assert.True(object.ReferenceEquals(differentIntColumn, dataFrame.Columns[1])); + + dataFrame.Columns.RemoveAt(1); + Assert.Single(dataFrame.Columns); + Assert.True(ReferenceEquals(intColumn, dataFrame.Columns[0])); + + // Test the params constructor + DataFrame dataFrame1 = new DataFrame(intColumn, floatColumn); + Assert.Equal(2, dataFrame1.Columns.Count); + Assert.Equal(intColumn, dataFrame1.Columns[0]); + Assert.Equal(floatColumn, dataFrame1.Columns[1]); + } + + [Fact] + public void InsertAndRemoveColumnTests() + { + DataFrame dataFrame = MakeDataFrameWithAllMutableColumnTypes(10); + DataFrameColumn intColumn = new Int32DataFrameColumn("IntColumn", Enumerable.Range(0, 10).Select(x => x)); + DataFrameColumn charColumn = dataFrame.Columns["Char"]; + int insertedIndex = dataFrame.Columns.Count; + dataFrame.Columns.Insert(dataFrame.Columns.Count, intColumn); + dataFrame.Columns.RemoveAt(0); + DataFrameColumn intColumn_1 = dataFrame.Columns["IntColumn"]; + DataFrameColumn charColumn_1 = dataFrame.Columns["Char"]; + Assert.True(ReferenceEquals(intColumn, intColumn_1)); + Assert.True(ReferenceEquals(charColumn, charColumn_1)); + } + + [Fact] + public void TestBinaryOperations() + { + DataFrame df = MakeDataFrameWithTwoColumns(12); + IReadOnlyList listOfInts = new List() { 5, 5 }; + + // The following binary ops return a copy + var ret = df.Add(5); + Assert.Equal(0, df[0, 0]); + Assert.Equal(5, ret[0, 0]); + ret = df.Add(listOfInts); + Assert.Equal(0, df[0, 0]); + Assert.Equal(5, ret[0, 0]); + ret = df.Subtract(5); + Assert.Equal(0, df[0, 0]); + Assert.Equal(-5, ret[0, 0]); + ret = df.Subtract(listOfInts); + Assert.Equal(0, df[0, 0]); + Assert.Equal(-5, ret[0, 0]); + ret = df.Multiply(5); + Assert.Equal(1, df[1, 0]); + Assert.Equal(5, ret[1, 0]); + ret = df.Multiply(listOfInts); + Assert.Equal(1, df[1, 0]); + Assert.Equal(5, ret[1, 0]); + ret = df.Divide(5); + Assert.Equal(5, df[5, 0]); + Assert.Equal(1, ret[5, 0]); + ret = df.Divide(listOfInts); + Assert.Equal(5, df[5, 0]); + Assert.Equal(1, ret[5, 0]); + ret = df.Modulo(5); + Assert.Equal(5, df[5, 0]); + Assert.Equal(0, ret[5, 0]); + ret = df.Modulo(listOfInts); + Assert.Equal(5, df[5, 0]); + Assert.Equal(0, ret[5, 0]); + + Assert.Equal(true, df.ElementwiseGreaterThanOrEqual(5)[7, 0]); + Assert.Equal(true, df.ElementwiseGreaterThanOrEqual(listOfInts)[7, 0]); + Assert.Equal(true, df.ElementwiseLessThanOrEqual(5)[4, 0]); + Assert.Equal(true, df.ElementwiseLessThanOrEqual(listOfInts)[4, 0]); + Assert.Equal(false, df.ElementwiseGreaterThan(5)[5, 0]); + Assert.Equal(false, df.ElementwiseGreaterThan(listOfInts)[5, 0]); + Assert.Equal(false, df.ElementwiseLessThan(5)[5, 0]); + Assert.Equal(false, df.ElementwiseLessThan(listOfInts)[5, 0]); + // The following binary ops are in place + Assert.Equal(5, df.Add(5, inPlace: true)[0, 0]); + Assert.Equal(10, df.Add(listOfInts, inPlace: true)[0, 0]); + Assert.Equal(5, df.Subtract(5, inPlace: true)[0, 0]); + Assert.Equal(0, df.Subtract(listOfInts, inPlace: true)[0, 0]); + Assert.Equal(5, df.Multiply(5, inPlace: true)[1, 0]); + Assert.Equal(25, df.Multiply(listOfInts, inPlace: true)[1, 0]); + Assert.Equal(5, df.Divide(5, inPlace: true)[1, 0]); + Assert.Equal(1, df.Divide(listOfInts, inPlace: true)[1, 0]); + Assert.Equal(1, df.Modulo(5, inPlace: true)[1, 0]); + Assert.Equal(1, df.Modulo(listOfInts, inPlace: true)[1, 0]); + Assert.Equal(2, df.LeftShift(1)[1, 0]); + Assert.Equal(1, df.RightShift(1)[2, 0]); + } + + [Fact] + public void TestBinaryOperationsWithColumns() + { + int length = 10; + var df1 = MakeDataFrameWithNumericColumns(length); + var df2 = MakeDataFrameWithNumericColumns(length); + + DataFrameColumn newColumn; + DataFrameColumn verify; + for (int i = 0; i < df1.Columns.Count; i++) + { + newColumn = df1.Columns[df1.Columns[i].Name] + df2.Columns[df2.Columns[i].Name]; + verify = newColumn.ElementwiseEquals(df1.Columns[i] * 2); + Assert.Equal(true, verify[0]); + + newColumn = df1.Columns[df1.Columns[i].Name] - df2.Columns[df2.Columns[i].Name]; + verify = newColumn.ElementwiseEquals(0); + Assert.Equal(true, verify[0]); + + newColumn = df1.Columns[df1.Columns[i].Name] * df2.Columns[df2.Columns[i].Name]; + verify = newColumn.ElementwiseEquals(df1.Columns[i] * df1.Columns[i]); + Assert.Equal(true, verify[0]); + + var df1Column = df1.Columns[i] + 1; + var df2Column = df2.Columns[i] + 1; + newColumn = df1Column / df2Column; + verify = newColumn.ElementwiseEquals(1); + Assert.Equal(true, verify[0]); + + newColumn = df1Column % df2Column; + verify = newColumn.ElementwiseEquals(0); + Assert.Equal(true, verify[0]); + + verify = df1.Columns[df1.Columns[i].Name].ElementwiseEquals(df2.Columns[df2.Columns[i].Name]); + Assert.True(verify.All()); + + verify = df1.Columns[df1.Columns[i].Name].ElementwiseNotEquals(df2.Columns[df2.Columns[i].Name]); + Assert.False(verify.Any()); + + verify = df1.Columns[df1.Columns[i].Name].ElementwiseGreaterThanOrEqual(df2.Columns[df2.Columns[i].Name]); + Assert.True(verify.All()); + + verify = df1.Columns[df1.Columns[i].Name].ElementwiseLessThanOrEqual(df2.Columns[df2.Columns[i].Name]); + Assert.True(verify.All()); + + verify = df1.Columns[df1.Columns[i].Name].ElementwiseGreaterThan(df2.Columns[df2.Columns[i].Name]); + Assert.False(verify.Any()); + + verify = df1.Columns[df1.Columns[i].Name].ElementwiseLessThan(df2.Columns[df2.Columns[i].Name]); + Assert.False(verify.Any()); + } + } + + [Fact] + public void TestBinaryOperationsWithConversions() + { + DataFrame df = DataFrameTests.MakeDataFrameWithTwoColumns(10); + + // Add a double to an int column + DataFrame dfd = df.Add(5.0f); + var dtype = dfd.Columns[0].DataType; + Assert.True(dtype == typeof(double)); + + // Add a decimal to an int column + DataFrame dfm = df.Add(5.0m); + dtype = dfm.Columns[0].DataType; + Assert.True(dtype == typeof(decimal)); + + // int + bool should throw + Assert.Throws(() => df.Add(true)); + + var dataFrameColumn1 = new DoubleDataFrameColumn("Double1", Enumerable.Range(0, 10).Select(x => (double)x)); + df.Columns[0] = dataFrameColumn1; + // Double + comparison ops should throw + Assert.Throws(() => df.And(true)); + } + + [Fact] + public void TestBinaryOperationsOnBoolColumn() + { + var df = new DataFrame(); + var dataFrameColumn1 = new BooleanDataFrameColumn("Bool1", Enumerable.Range(0, 10).Select(x => true)); + var dataFrameColumn2 = new BooleanDataFrameColumn("Bool2", Enumerable.Range(0, 10).Select(x => true)); + df.Columns.Insert(0, dataFrameColumn1); + df.Columns.Insert(1, dataFrameColumn2); + + // bool + int should throw + Assert.Throws(() => df.Add(5)); + // Left shift should throw + Assert.Throws(() => df.LeftShift(5)); + + IReadOnlyList listOfBools = new List() { true, false }; + // boolean and And should work + var newdf = df.And(true); + Assert.Equal(true, newdf[4, 0]); + var newdf1 = df.And(listOfBools); + Assert.Equal(false, newdf1[4, 1]); + + newdf = df.Or(true); + Assert.Equal(true, newdf[4, 0]); + newdf1 = df.Or(listOfBools); + Assert.Equal(true, newdf1[4, 1]); + + newdf = df.Xor(true); + Assert.Equal(false, newdf[4, 0]); + newdf1 = df.Xor(listOfBools); + Assert.Equal(true, newdf1[4, 1]); + } + + [Fact] + public void TestBinaryOperationsOnArrowStringColumn() + { + var df = new DataFrame(); + var strArrayBuilder = new StringArray.Builder(); + for (int i = 0; i < 10; i++) + { + strArrayBuilder.Append(i.ToString()); + } + StringArray strArray = strArrayBuilder.Build(); + + ArrowStringDataFrameColumn stringColumn = new ArrowStringDataFrameColumn("String", strArray.ValueBuffer.Memory, strArray.ValueOffsetsBuffer.Memory, strArray.NullBitmapBuffer.Memory, strArray.Length, strArray.NullCount); + df.Columns.Insert(0, stringColumn); + + DataFrameColumn newCol = stringColumn.ElementwiseEquals(4); + Assert.Equal(true, newCol[4]); + Assert.Equal(false, newCol[0]); + Assert.Equal(false, newCol[5]); + + newCol = stringColumn.ElementwiseEquals("4"); + Assert.Equal(true, newCol[4]); + Assert.Equal(false, newCol[0]); + + newCol = stringColumn.ElementwiseEquals("foo"); + Assert.False(newCol.All()); + newCol = stringColumn.ElementwiseEquals(null); + Assert.False(newCol.All()); + + ArrowStringDataFrameColumn stringColumnCopy = new ArrowStringDataFrameColumn("String", strArray.ValueBuffer.Memory, strArray.ValueOffsetsBuffer.Memory, strArray.NullBitmapBuffer.Memory, strArray.Length, strArray.NullCount); + newCol = stringColumn.ElementwiseEquals(stringColumnCopy); + Assert.True(newCol.All()); + + DataFrameColumn stringColumnCopyAsBaseColumn = stringColumnCopy; + newCol = stringColumn.ElementwiseEquals(stringColumnCopyAsBaseColumn); + Assert.True(newCol.All()); + + newCol = stringColumn.ElementwiseNotEquals(5); + Assert.Equal(true, newCol[0]); + Assert.Equal(false, newCol[5]); + + newCol = stringColumn.ElementwiseNotEquals("5"); + Assert.Equal(true, newCol[0]); + Assert.Equal(false, newCol[5]); + + newCol = stringColumn.ElementwiseNotEquals("foo"); + Assert.True(newCol.All()); + newCol = stringColumn.ElementwiseNotEquals(null); + Assert.True(newCol.All()); + + newCol = stringColumn.ElementwiseNotEquals(stringColumnCopy); + Assert.False(newCol.All()); + + newCol = stringColumn.ElementwiseNotEquals(stringColumnCopyAsBaseColumn); + Assert.False(newCol.All()); + } + + [Fact] + public void TestBinaryOperationsOnStringColumn() + { + var df = new DataFrame(); + DataFrameColumn stringColumn = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString())); + df.Columns.Insert(0, stringColumn); + + DataFrameColumn newCol = stringColumn.ElementwiseEquals(5); + Assert.Equal(true, newCol[5]); + Assert.Equal(false, newCol[0]); + + newCol = (stringColumn as StringDataFrameColumn).ElementwiseEquals("5"); + Assert.Equal(true, newCol[5]); + Assert.Equal(false, newCol[0]); + + DataFrameColumn stringColumnCopy = new StringDataFrameColumn("String", Enumerable.Range(0, 10).Select(x => x.ToString())); + newCol = stringColumn.ElementwiseEquals(stringColumnCopy); + Assert.Equal(true, newCol[5]); + Assert.Equal(true, newCol[0]); + + StringDataFrameColumn typedStringColumn = stringColumn as StringDataFrameColumn; + StringDataFrameColumn typedStringColumnCopy = stringColumnCopy as StringDataFrameColumn; + newCol = typedStringColumn.ElementwiseEquals(typedStringColumnCopy); + Assert.True(newCol.All()); + + newCol = stringColumn.ElementwiseNotEquals(5); + Assert.Equal(false, newCol[5]); + Assert.Equal(true, newCol[0]); + + newCol = typedStringColumn.ElementwiseNotEquals("5"); + Assert.Equal(false, newCol[5]); + Assert.Equal(true, newCol[0]); + + newCol = stringColumn.ElementwiseNotEquals(stringColumnCopy); + Assert.Equal(false, newCol[5]); + Assert.Equal(false, newCol[0]); + + newCol = typedStringColumn.ElementwiseNotEquals(typedStringColumnCopy); + Assert.False(newCol.All()); + + newCol = typedStringColumn.Add("suffix"); + for (int i = 0; i < newCol.Length; i++) + { + Assert.Equal(newCol[i], typedStringColumn[i] + "suffix"); + } + DataFrameColumn addString = typedStringColumn + "suffix"; + for (int i = 0; i < addString.Length; i++) + { + Assert.Equal(addString[i], typedStringColumn[i] + "suffix"); + } + Assert.True(newCol.ElementwiseEquals(addString).All()); + addString = "prefix" + typedStringColumn; + for (int i = 0; i < addString.Length; i++) + { + Assert.Equal(addString[i], "prefix" + typedStringColumn[i]); + } + } + + [Fact] + public void TestBinaryOperatorsWithConversions() + { + var df = MakeDataFrameWithNumericColumns(10); + + DataFrame tempDf = df + 1; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] + (double)1); + tempDf = df + 1.1; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] + 1.1); + tempDf = df + 1.1m; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] + 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = df - 1.1; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] - 1.1); + tempDf = df - 1.1m; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] - 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = df * 1.1; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] * 1.1); + tempDf = df * 1.1m; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] * 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = df / 1.1; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] / 1.1); + tempDf = df / 1.1m; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] / 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = df % 1.1; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] % 1.1); + tempDf = df % 1.1m; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] % 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = 1 + df; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] + (double)1); + tempDf = 1.1 + df; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] + 1.1); + tempDf = 1.1m + df; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] + 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = 1.1 - df; + Assert.Equal(tempDf[0, 0], 1.1 - (byte)df[0, 0]); + tempDf = 1.1m - df; + Assert.Equal(tempDf[0, 0], 1.1m - (byte)df[0, 0]); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = 1.1 * df; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] * 1.1); + tempDf = 1.1m * df; + Assert.Equal(tempDf[0, 0], (byte)df[0, 0] * 1.1m); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + // To prevent a divide by zero + var plusOne = df + 1; + tempDf = 1.1 / plusOne; + Assert.Equal(tempDf[0, 0], 1.1 / (double)plusOne[0, 0]); + var plusDecimal = df + 1.1m; + tempDf = 1.1m / plusDecimal; + Assert.Equal(tempDf[0, 0], (1.1m) / (decimal)plusDecimal[0, 0]); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + tempDf = 1.1 % plusOne; + Assert.Equal(tempDf[0, 0], 1.1 % (double)plusOne[0, 0]); + tempDf = 1.1m % plusDecimal; + Assert.Equal(tempDf[0, 0], 1.1m % (decimal)plusDecimal[0, 0]); + Assert.True(typeof(decimal) == tempDf.Columns["Int"].DataType); + + Assert.Equal((byte)0, df[0, 0]); + } + + [Fact] + public void TestBinaryOperationsOnColumns() + { + Int32DataFrameColumn column = new Int32DataFrameColumn("Int", Enumerable.Range(0, 10)); + Assert.ThrowsAny(() => column.Add(5.5, inPlace: true)); + Assert.ThrowsAny(() => column.ReverseAdd(5.5, inPlace: true)); + string str = "A String"; + Assert.ThrowsAny(() => column.Add(str, inPlace: true)); + Assert.ThrowsAny(() => column.ReverseAdd(str, inPlace: true)); + } + + [Fact] + public void TestColumnReverseOrderState() + { + var column = new Int32DataFrameColumn("Int", Enumerable.Range(0, 10)); + var newColumn = 1 - column; + var checkOrderColumn = 1 - newColumn; + Assert.True(checkOrderColumn.ElementwiseEquals(column).All()); + } + + [Fact] + public void TestProjectionAndAppend() + { + DataFrame df = MakeDataFrameWithTwoColumns(10); + + df["Int3"] = df.Columns["Int1"] * 2 + df.Columns["Int2"]; + Assert.Equal(16, df.Columns["Int3"][2]); + } + + [Fact] + public void TestComputations() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); + df["Int"][0] = -10; + Assert.Equal(-10, df.Columns["Int"][0]); + + DataFrameColumn absColumn = df.Columns["Int"].Abs(); + Assert.Equal(10, absColumn[0]); + Assert.Equal(-10, df.Columns["Int"][0]); + df.Columns["Int"].Abs(true); + Assert.Equal(10, df.Columns["Int"][0]); + + Assert.Throws(() => df.Columns["Byte"].All()); + Assert.Throws(() => df.Columns["Byte"].Any()); + Assert.Throws(() => df.Columns["Char"].All()); + Assert.Throws(() => df.Columns["Char"].Any()); + Assert.Throws(() => df.Columns["Decimal"].All()); + Assert.Throws(() => df.Columns["Decimal"].Any()); + Assert.Throws(() => df.Columns["Double"].All()); + Assert.Throws(() => df.Columns["Double"].Any()); + Assert.Throws(() => df.Columns["Float"].All()); + Assert.Throws(() => df.Columns["Float"].Any()); + Assert.Throws(() => df.Columns["Int"].All()); + Assert.Throws(() => df.Columns["Int"].Any()); + Assert.Throws(() => df.Columns["Long"].All()); + Assert.Throws(() => df.Columns["Long"].Any()); + Assert.Throws(() => df.Columns["Sbyte"].All()); + Assert.Throws(() => df.Columns["Sbyte"].Any()); + Assert.Throws(() => df.Columns["Short"].All()); + Assert.Throws(() => df.Columns["Short"].Any()); + Assert.Throws(() => df.Columns["Uint"].All()); + Assert.Throws(() => df.Columns["Uint"].Any()); + Assert.Throws(() => df.Columns["Ulong"].All()); + Assert.Throws(() => df.Columns["Ulong"].Any()); + Assert.Throws(() => df.Columns["Ushort"].All()); + Assert.Throws(() => df.Columns["Ushort"].Any()); + + bool any = df.Columns["Bool"].Any(); + bool all = df.Columns["Bool"].All(); + Assert.True(any); + Assert.False(all); + + // Test the computation results + df.Columns["Double"][0] = 100.0; + DataFrameColumn doubleColumn = df.Columns["Double"].CumulativeMax(); + for (int i = 0; i < doubleColumn.Length; i++) + { + if (i == 5) + Assert.Null(doubleColumn[i]); + else + Assert.Equal(100.0, (double)doubleColumn[i]); + } + Assert.Equal(1.0, df.Columns["Double"][1]); + df.Columns["Double"].CumulativeMax(true); + for (int i = 0; i < df.Columns["Double"].Length; i++) + { + if (i == 5) + Assert.Null(df.Columns["Double"][i]); + else + Assert.Equal(100.0, (double)df.Columns["Double"][i]); + } + + df.Columns["Float"][0] = -10.0f; + DataFrameColumn floatColumn = df.Columns["Float"].CumulativeMin(); + for (int i = 0; i < floatColumn.Length; i++) + { + if (i == 5) + Assert.Null(floatColumn[i]); + else + Assert.Equal(-10.0f, (float)floatColumn[i]); + } + Assert.Equal(9.0f, df.Columns["Float"][9]); + df.Columns["Float"].CumulativeMin(true); + for (int i = 0; i < df.Columns["Float"].Length; i++) + { + if (i == 5) + Assert.Null(df.Columns["Float"][i]); + else + Assert.Equal(-10.0f, (float)df.Columns["Float"][i]); + } + + DataFrameColumn uintColumn = df.Columns["Uint"].CumulativeProduct(); + Assert.Equal((uint)0, uintColumn[8]); + Assert.Equal((uint)8, df.Columns["Uint"][8]); + df.Columns["Uint"].CumulativeProduct(true); + Assert.Equal((uint)0, df.Columns["Uint"][9]); + + DataFrameColumn ushortColumn = df.Columns["Ushort"].CumulativeSum(); + Assert.Equal((ushort)40, ushortColumn[9]); + Assert.Equal((ushort)9, df.Columns["Ushort"][9]); + df.Columns["Ushort"].CumulativeSum(true); + Assert.Equal((ushort)40, df.Columns["Ushort"][9]); + + Assert.Equal(100.0, df.Columns["Double"].Max()); + Assert.Equal(-10.0f, df.Columns["Float"].Min()); + Assert.Equal((uint)0, df.Columns["Uint"].Product()); + Assert.Equal((ushort)140, df.Columns["Ushort"].Sum()); + + df.Columns["Double"][0] = 100.1; + Assert.Equal(100.1, df.Columns["Double"][0]); + DataFrameColumn roundColumn = df.Columns["Double"].Round(); + Assert.Equal(100.0, roundColumn[0]); + Assert.Equal(100.1, df.Columns["Double"][0]); + df.Columns["Double"].Round(true); + Assert.Equal(100.0, df.Columns["Double"][0]); + + // Test that none of the numeric column types throw + for (int i = 0; i < df.Columns.Count; i++) + { + DataFrameColumn column = df.Columns[i]; + if (column.DataType == typeof(bool)) + { + Assert.Throws(() => column.CumulativeMax()); + Assert.Throws(() => column.CumulativeMin()); + Assert.Throws(() => column.CumulativeProduct()); + Assert.Throws(() => column.CumulativeSum()); + Assert.Throws(() => column.Max()); + Assert.Throws(() => column.Min()); + Assert.Throws(() => column.Product()); + Assert.Throws(() => column.Sum()); + continue; + } + else if (column.DataType == typeof(string)) + { + Assert.Throws(() => column.CumulativeMax()); + Assert.Throws(() => column.CumulativeMin()); + Assert.Throws(() => column.CumulativeProduct()); + Assert.Throws(() => column.CumulativeSum()); + Assert.Throws(() => column.Max()); + Assert.Throws(() => column.Min()); + Assert.Throws(() => column.Product()); + Assert.Throws(() => column.Sum()); + continue; + } + column.CumulativeMax(); + column.CumulativeMin(); + column.CumulativeProduct(); + column.CumulativeSum(); + column.Max(); + column.Min(); + column.Product(); + column.Sum(); + } + } + + [Fact] + public void TestOrderBy() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(20); + df.Columns["Int"][0] = 100; + df.Columns["Int"][19] = -1; + df.Columns["Int"][5] = 2000; + + // Sort by "Int" in ascending order + var sortedDf = df.OrderBy("Int"); + Assert.Null(sortedDf.Columns["Int"][19]); + Assert.Equal(-1, sortedDf.Columns["Int"][0]); + Assert.Equal(100, sortedDf.Columns["Int"][17]); + Assert.Equal(2000, sortedDf.Columns["Int"][18]); + + // Sort by "Int" in descending order + sortedDf = df.OrderByDescending("Int"); + Assert.Null(sortedDf.Columns["Int"][19]); + Assert.Equal(-1, sortedDf.Columns["Int"][18]); + Assert.Equal(100, sortedDf.Columns["Int"][1]); + Assert.Equal(2000, sortedDf.Columns["Int"][0]); + + // Sort by "String" in ascending order + sortedDf = df.OrderBy("String"); + Assert.Null(sortedDf.Columns["Int"][19]); + Assert.Equal(1, sortedDf.Columns["Int"][1]); + Assert.Equal(8, sortedDf.Columns["Int"][17]); + Assert.Equal(9, sortedDf.Columns["Int"][18]); + + // Sort by "String" in descending order + sortedDf = df.OrderByDescending("String"); + Assert.Null(sortedDf.Columns["Int"][19]); + Assert.Equal(8, sortedDf.Columns["Int"][1]); + Assert.Equal(9, sortedDf.Columns["Int"][0]); + } + + [Fact] + public void TestSplitAndSort() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(20); + df.Columns["Int"][0] = 100000; + df.Columns["Int"][df.Rows.Count - 1] = -1; + df.Columns["Int"][5] = 200000; + DataFrame dfTest; + DataFrame dfTrain = SplitTrainTest(df, 0.8f, out dfTest); + + // Sort by "Int" in ascending order + var sortedDf = dfTrain.OrderBy("Int"); + Assert.Null(sortedDf.Columns["Int"][sortedDf.Rows.Count - 1]); + Assert.Equal(1, sortedDf.Columns["Int"][0]); + Assert.Equal(100000, sortedDf.Columns["Int"][sortedDf.Rows.Count - 3]); + Assert.Equal(200000, sortedDf.Columns["Int"][sortedDf.Rows.Count - 2]); + } + + [Fact] + public void TestStringColumnSort() + { + // StringDataFrameColumn specific sort tests + StringDataFrameColumn strColumn = new StringDataFrameColumn("String", 0); + Assert.Equal(0, strColumn.NullCount); + for (int i = 0; i < 5; i++) + { + strColumn.Append(null); + } + Assert.Equal(5, strColumn.NullCount); + // Should handle all nulls + StringDataFrameColumn sortedStrColumn = strColumn.Sort() as StringDataFrameColumn; + Assert.Equal(5, sortedStrColumn.NullCount); + Assert.Null(sortedStrColumn[0]); + + for (int i = 0; i < 5; i++) + { + strColumn.Append(i.ToString()); + } + Assert.Equal(5, strColumn.NullCount); + + // Ascending sort + sortedStrColumn = strColumn.Sort() as StringDataFrameColumn; + Assert.Equal("0", sortedStrColumn[0]); + Assert.Null(sortedStrColumn[9]); + + // Descending sort + sortedStrColumn = strColumn.Sort(false) as StringDataFrameColumn; + Assert.Equal("4", sortedStrColumn[0]); + Assert.Null(sortedStrColumn[9]); + } + + [Theory] + [InlineData(5)] + [InlineData(12)] + [InlineData(100)] + [InlineData(1000)] + public void TestPrimitiveColumnSort(int numberOfNulls) + { + // Primitive Column Sort + Int32DataFrameColumn intColumn = new Int32DataFrameColumn("Int", 0); + Assert.Equal(0, intColumn.NullCount); + intColumn.AppendMany(null, numberOfNulls); + Assert.Equal(numberOfNulls, intColumn.NullCount); + + // Should handle all nulls + PrimitiveDataFrameColumn sortedIntColumn = intColumn.Sort(); + Assert.Equal(numberOfNulls, sortedIntColumn.NullCount); + Assert.Null(sortedIntColumn[0]); + + for (int i = 0; i < 5; i++) + { + intColumn.Append(i); + } + Assert.Equal(numberOfNulls, intColumn.NullCount); + + // Ascending sort + sortedIntColumn = intColumn.Sort(); + Assert.Equal(0, sortedIntColumn[0]); + Assert.Null(sortedIntColumn[9]); + + // Descending sort + sortedIntColumn = intColumn.Sort(ascending: false); + Assert.Equal(4, sortedIntColumn[0]); + Assert.Null(sortedIntColumn[9]); + } + + private void VerifyJoin(DataFrame join, DataFrame left, DataFrame right, JoinAlgorithm joinAlgorithm) + { + Int64DataFrameColumn mapIndices = new Int64DataFrameColumn("map", join.Rows.Count); + for (long i = 0; i < join.Rows.Count; i++) + { + mapIndices[i] = i; + } + for (int i = 0; i < join.Columns.Count; i++) + { + DataFrameColumn joinColumn = join.Columns[i]; + DataFrameColumn isEqual; + + if (joinAlgorithm == JoinAlgorithm.Left) + { + if (i < left.Columns.Count) + { + DataFrameColumn leftColumn = left.Columns[i]; + isEqual = joinColumn.ElementwiseEquals(leftColumn); + } + else + { + int columnIndex = i - left.Columns.Count; + DataFrameColumn rightColumn = right.Columns[columnIndex]; + DataFrameColumn compareColumn = rightColumn.Length <= join.Rows.Count ? rightColumn.Clone(numberOfNullsToAppend: join.Rows.Count - rightColumn.Length) : rightColumn.Clone(mapIndices); + isEqual = joinColumn.ElementwiseEquals(compareColumn); + } + } + else if (joinAlgorithm == JoinAlgorithm.Right) + { + if (i < left.Columns.Count) + { + DataFrameColumn leftColumn = left.Columns[i]; + DataFrameColumn compareColumn = leftColumn.Length <= join.Rows.Count ? leftColumn.Clone(numberOfNullsToAppend: join.Rows.Count - leftColumn.Length) : leftColumn.Clone(mapIndices); + isEqual = joinColumn.ElementwiseEquals(compareColumn); + } + else + { + int columnIndex = i - left.Columns.Count; + DataFrameColumn rightColumn = right.Columns[columnIndex]; + isEqual = joinColumn.ElementwiseEquals(rightColumn); + } + } + else if (joinAlgorithm == JoinAlgorithm.Inner) + { + if (i < left.Columns.Count) + { + DataFrameColumn leftColumn = left.Columns[i]; + isEqual = joinColumn.ElementwiseEquals(leftColumn.Clone(mapIndices)); + } + else + { + int columnIndex = i - left.Columns.Count; + DataFrameColumn rightColumn = right.Columns[columnIndex]; + isEqual = joinColumn.ElementwiseEquals(rightColumn.Clone(mapIndices)); + } + } + else + { + if (i < left.Columns.Count) + { + DataFrameColumn leftColumn = left.Columns[i]; + isEqual = joinColumn.ElementwiseEquals(leftColumn.Clone(numberOfNullsToAppend: join.Rows.Count - leftColumn.Length)); + } + else + { + int columnIndex = i - left.Columns.Count; + DataFrameColumn rightColumn = right.Columns[columnIndex]; + isEqual = joinColumn.ElementwiseEquals(rightColumn.Clone(numberOfNullsToAppend: join.Rows.Count - rightColumn.Length)); + } + } + for (int j = 0; j < join.Rows.Count; j++) + { + Assert.Equal(true, isEqual[j]); + } + } + } + + private void VerifyMerge(DataFrame merge, DataFrame left, DataFrame right, JoinAlgorithm joinAlgorithm) + { + if (joinAlgorithm == JoinAlgorithm.Left || joinAlgorithm == JoinAlgorithm.Inner) + { + HashSet intersection = new HashSet(); + for (int i = 0; i < merge.Columns["Int_left"].Length; i++) + { + if (merge.Columns["Int_left"][i] == null) + continue; + intersection.Add((int)merge.Columns["Int_left"][i]); + } + for (int i = 0; i < left.Columns["Int"].Length; i++) + { + if (left.Columns["Int"][i] != null && intersection.Contains((int)left.Columns["Int"][i])) + intersection.Remove((int)left.Columns["Int"][i]); + } + Assert.Empty(intersection); + } + else if (joinAlgorithm == JoinAlgorithm.Right) + { + HashSet intersection = new HashSet(); + for (int i = 0; i < merge.Columns["Int_right"].Length; i++) + { + if (merge.Columns["Int_right"][i] == null) + continue; + intersection.Add((int)merge.Columns["Int_right"][i]); + } + for (int i = 0; i < right.Columns["Int"].Length; i++) + { + if (right.Columns["Int"][i] != null && intersection.Contains((int)right.Columns["Int"][i])) + intersection.Remove((int)right.Columns["Int"][i]); + } + Assert.Empty(intersection); + } + else if (joinAlgorithm == JoinAlgorithm.FullOuter) + { + VerifyMerge(merge, left, right, JoinAlgorithm.Left); + VerifyMerge(merge, left, right, JoinAlgorithm.Right); + } + } + + [Fact] + public void TestJoin() + { + DataFrame left = MakeDataFrameWithAllMutableColumnTypes(10); + DataFrame right = MakeDataFrameWithAllMutableColumnTypes(5); + + // Tests with right.Rows.Count < left.Rows.Count + // Left join + DataFrame join = left.Join(right); + Assert.Equal(join.Rows.Count, left.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Null(join.Columns["Int_right"][6]); + VerifyJoin(join, left, right, JoinAlgorithm.Left); + + // Right join + join = left.Join(right, joinAlgorithm: JoinAlgorithm.Right); + Assert.Equal(join.Rows.Count, right.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(join.Columns["Int_right"][3], right.Columns["Int"][3]); + Assert.Null(join.Columns["Int_right"][2]); + VerifyJoin(join, left, right, JoinAlgorithm.Right); + + // Outer join + join = left.Join(right, joinAlgorithm: JoinAlgorithm.FullOuter); + Assert.Equal(join.Rows.Count, left.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Null(join.Columns["Int_right"][6]); + VerifyJoin(join, left, right, JoinAlgorithm.FullOuter); + + // Inner join + join = left.Join(right, joinAlgorithm: JoinAlgorithm.Inner); + Assert.Equal(join.Rows.Count, right.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(join.Columns["Int_right"][3], right.Columns["Int"][3]); + Assert.Null(join.Columns["Int_right"][2]); + VerifyJoin(join, left, right, JoinAlgorithm.Inner); + + // Tests with right.Rows.Count > left.Rows.Count + // Left join + right = MakeDataFrameWithAllMutableColumnTypes(15); + join = left.Join(right); + Assert.Equal(join.Rows.Count, left.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(join.Columns["Int_right"][6], right.Columns["Int"][6]); + VerifyJoin(join, left, right, JoinAlgorithm.Left); + + // Right join + join = left.Join(right, joinAlgorithm: JoinAlgorithm.Right); + Assert.Equal(join.Rows.Count, right.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(join.Columns["Int_right"][2], right.Columns["Int"][2]); + Assert.Null(join.Columns["Int_left"][12]); + VerifyJoin(join, left, right, JoinAlgorithm.Right); + + // Outer join + join = left.Join(right, joinAlgorithm: JoinAlgorithm.FullOuter); + Assert.Equal(join.Rows.Count, right.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Null(join.Columns["Int_left"][12]); + VerifyJoin(join, left, right, JoinAlgorithm.FullOuter); + + // Inner join + join = left.Join(right, joinAlgorithm: JoinAlgorithm.Inner); + Assert.Equal(join.Rows.Count, left.Rows.Count); + Assert.Equal(join.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(join.Columns["Int_right"][2], right.Columns["Int"][2]); + VerifyJoin(join, left, right, JoinAlgorithm.Inner); + } + + [Fact] + public void TestGroupBy() + { + DataFrame df = MakeDataFrameWithNumericAndBoolColumns(10); + DataFrame count = df.GroupBy("Bool").Count(); + Assert.Equal(2, count.Rows.Count); + Assert.Equal((long)5, count.Columns["Int"][0]); + Assert.Equal((long)4, count.Columns["Decimal"][1]); + for (int r = 0; r < count.Rows.Count; r++) + { + for (int c = 1; c < count.Columns.Count; c++) + { + Assert.Equal((long)(r == 0 ? 5 : 4), count.Columns[c][r]); + } + } + + DataFrame first = df.GroupBy("Bool").First(); + Assert.Equal(2, first.Rows.Count); + for (int r = 0; r < 2; r++) + { + for (int c = 0; c < count.Columns.Count; c++) + { + DataFrameColumn originalColumn = df.Columns[c]; + DataFrameColumn firstColumn = first.Columns[originalColumn.Name]; + Assert.Equal(originalColumn[r], firstColumn[r]); + } + } + + DataFrame head = df.GroupBy("Bool").Head(3); + List verify = new List() { 0, 3, 1, 4, 2, 5 }; + for (int r = 0; r < 5; r++) + { + for (int c = 0; c < count.Columns.Count; c++) + { + DataFrameColumn originalColumn = df.Columns[c]; + DataFrameColumn headColumn = head.Columns[originalColumn.Name]; + Assert.Equal(originalColumn[r].ToString(), headColumn[verify[r]].ToString()); + } + } + for (int c = 0; c < count.Columns.Count; c++) + { + DataFrameColumn originalColumn = df.Columns[c]; + if (originalColumn.Name == "Bool") + continue; + DataFrameColumn headColumn = head.Columns[originalColumn.Name]; + Assert.Equal(originalColumn[5], headColumn[verify[5]]); + } + Assert.Equal(6, head.Rows.Count); + + DataFrame tail = df.GroupBy("Bool").Tail(3); + Assert.Equal(6, tail.Rows.Count); + List originalColumnVerify = new List() { 6, 8, 7, 9 }; + List tailColumnVerity = new List() { 1, 2, 4, 5 }; + for (int r = 0; r < 4; r++) + { + for (int c = 0; c < count.Columns.Count; c++) + { + DataFrameColumn originalColumn = df.Columns[c]; + DataFrameColumn tailColumn = tail.Columns[originalColumn.Name]; + Assert.Equal(originalColumn[originalColumnVerify[r]].ToString(), tailColumn[tailColumnVerity[r]].ToString()); + } + } + + DataFrame max = df.GroupBy("Bool").Max(); + Assert.Equal(2, max.Rows.Count); + for (int r = 0; r < 2; r++) + { + for (int c = 0; c < count.Columns.Count; c++) + { + DataFrameColumn originalColumn = df.Columns[c]; + if (originalColumn.Name == "Bool" || originalColumn.Name == "Char") + continue; + DataFrameColumn maxColumn = max.Columns[originalColumn.Name]; + Assert.Equal(((long)(r == 0 ? 8 : 9)).ToString(), maxColumn[r].ToString()); + } + } + + DataFrame min = df.GroupBy("Bool").Min(); + Assert.Equal(2, min.Rows.Count); + + DataFrame product = df.GroupBy("Bool").Product(); + Assert.Equal(2, product.Rows.Count); + + DataFrame sum = df.GroupBy("Bool").Sum(); + Assert.Equal(2, sum.Rows.Count); + + DataFrame mean = df.GroupBy("Bool").Mean(); + Assert.Equal(2, mean.Rows.Count); + for (int r = 0; r < 2; r++) + { + for (int c = 0; c < count.Columns.Count; c++) + { + DataFrameColumn originalColumn = df.Columns[c]; + if (originalColumn.Name == "Bool" || originalColumn.Name == "Char") + continue; + DataFrameColumn minColumn = min.Columns[originalColumn.Name]; + Assert.Equal("0", minColumn[r].ToString()); + + DataFrameColumn productColumn = product.Columns[originalColumn.Name]; + Assert.Equal("0", productColumn[r].ToString()); + + DataFrameColumn sumColumn = sum.Columns[originalColumn.Name]; + Assert.Equal("20", sumColumn[r].ToString()); + } + } + + DataFrame columnSum = df.GroupBy("Bool").Sum("Int"); + Assert.Equal(2, columnSum.Columns.Count); + Assert.Equal(20, columnSum.Columns["Int"][0]); + Assert.Equal(20, columnSum.Columns["Int"][1]); + DataFrame columnMax = df.GroupBy("Bool").Max("Int"); + Assert.Equal(2, columnMax.Columns.Count); + Assert.Equal(8, columnMax.Columns["Int"][0]); + Assert.Equal(9, columnMax.Columns["Int"][1]); + DataFrame columnProduct = df.GroupBy("Bool").Product("Int"); + Assert.Equal(2, columnProduct.Columns.Count); + Assert.Equal(0, columnProduct.Columns["Int"][0]); + Assert.Equal(0, columnProduct.Columns["Int"][1]); + DataFrame columnMin = df.GroupBy("Bool").Min("Int"); + Assert.Equal(2, columnMin.Columns.Count); + Assert.Equal(0, columnMin.Columns["Int"][0]); + Assert.Equal(0, columnMin.Columns["Int"][1]); + + DataFrame countIntColumn = df.GroupBy("Bool").Count("Int"); + Assert.Equal(2, countIntColumn.Columns.Count); + Assert.Equal(2, countIntColumn.Rows.Count); + Assert.Equal((long)5, countIntColumn.Columns["Int"][0]); + Assert.Equal((long)4, countIntColumn.Columns["Int"][1]); + + DataFrame firstDecimalColumn = df.GroupBy("Bool").First("Decimal"); + Assert.Equal(2, firstDecimalColumn.Columns.Count); + Assert.Equal(2, firstDecimalColumn.Rows.Count); + Assert.Equal((decimal)0, firstDecimalColumn.Columns["Decimal"][0]); + Assert.Equal((decimal)1, firstDecimalColumn.Columns["Decimal"][1]); + } + + [Fact] + public void TestGoupByDifferentColumnTypes() + { + void GroupCountAndAssert(DataFrame frame) + { + DataFrame grouped = frame.GroupBy("Column1").Count(); + Assert.Equal(2, grouped.Rows.Count); + } + + DataFrame df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + + df = MakeDataFrame(10, false); + GroupCountAndAssert(df); + } + + [Fact] + public void TestIEnumerable() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + + int totalValueCount = 0; + for (int i = 0; i < df.Columns.Count; i++) + { + DataFrameColumn baseColumn = df.Columns[i]; + foreach (object value in baseColumn) + { + totalValueCount++; + } + } + Assert.Equal(10 * df.Columns.Count, totalValueCount); + + // spot check a few column types: + + StringDataFrameColumn stringColumn = (StringDataFrameColumn)df.Columns["String"]; + StringBuilder actualStrings = new StringBuilder(); + foreach (string value in stringColumn) + { + if (value == null) + { + actualStrings.Append(""); + } + else + { + actualStrings.Append(value); + } + } + Assert.Equal("012346789", actualStrings.ToString()); + + ArrowStringDataFrameColumn arrowStringColumn = (ArrowStringDataFrameColumn)df.Columns["ArrowString"]; + actualStrings.Clear(); + foreach (string value in arrowStringColumn) + { + if (value == null) + { + actualStrings.Append(""); + } + else + { + actualStrings.Append(value); + } + } + Assert.Equal("foofoofoofoofoofoofoofoofoo", actualStrings.ToString()); + + SingleDataFrameColumn floatColumn = (SingleDataFrameColumn)df.Columns["Float"]; + actualStrings.Clear(); + foreach (float? value in floatColumn) + { + if (value == null) + { + actualStrings.Append(""); + } + else + { + actualStrings.Append(value); + } + } + Assert.Equal("012346789", actualStrings.ToString()); + + Int32DataFrameColumn intColumn = (Int32DataFrameColumn)df.Columns["Int"]; + actualStrings.Clear(); + foreach (int? value in intColumn) + { + if (value == null) + { + actualStrings.Append(""); + } + else + { + actualStrings.Append(value); + } + } + Assert.Equal("012346789", actualStrings.ToString()); + } + + [Fact] + public void TestColumnClamp() + { + DataFrame df = MakeDataFrameWithNumericColumns(10); + // Out of place + DataFrameColumn clamped = df.Columns["Int"].Clamp(3, 7); + Assert.Equal(3, clamped[0]); + Assert.Equal(0, df.Columns["Int"][0]); + Assert.Equal(3, clamped[1]); + Assert.Equal(1, df.Columns["Int"][1]); + Assert.Equal(3, clamped[2]); + Assert.Equal(2, df.Columns["Int"][2]); + Assert.Equal(3, clamped[3]); + Assert.Equal(3, df.Columns["Int"][3]); + Assert.Equal(4, clamped[4]); + Assert.Equal(4, df.Columns["Int"][4]); + Assert.Null(clamped[5]); + Assert.Null(df.Columns["Int"][5]); + Assert.Equal(6, clamped[6]); + Assert.Equal(6, df.Columns["Int"][6]); + Assert.Equal(7, clamped[7]); + Assert.Equal(7, df.Columns["Int"][7]); + Assert.Equal(7, clamped[8]); + Assert.Equal(8, df.Columns["Int"][8]); + Assert.Equal(7, clamped[9]); + Assert.Equal(9, df.Columns["Int"][9]); + + // In place + df.Columns["Int"].Clamp(3, 7, true); + Assert.Equal(3, df.Columns["Int"][0]); + Assert.Equal(3, df.Columns["Int"][1]); + Assert.Equal(3, df.Columns["Int"][2]); + Assert.Equal(3, df.Columns["Int"][3]); + Assert.Equal(4, df.Columns["Int"][4]); + Assert.Null(df.Columns["Int"][5]); + Assert.Equal(6, df.Columns["Int"][6]); + Assert.Equal(7, df.Columns["Int"][7]); + Assert.Equal(7, df.Columns["Int"][8]); + Assert.Equal(7, df.Columns["Int"][9]); + } + + [Fact] + public void TestColumnFilter() + { + DataFrame df = MakeDataFrameWithNumericColumns(10); + DataFrameColumn filtered = df.Columns["Int"].Filter(3, 7); + Assert.Equal(4, filtered.Length); + Assert.Equal(3, filtered[0]); + Assert.Equal(4, filtered[1]); + Assert.Equal(6, filtered[2]); + Assert.Equal(7, filtered[3]); + } + + [Fact] + public void TestDataFrameClamp() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + IEnumerable dfColumns = ((IDataView)df).Schema; + + void VerifyDataFrameClamp(DataFrame clampedColumn) + { + + IEnumerable clampedColumns = ((IDataView)clampedColumn).Schema; + Assert.Equal(df.Columns.Count, clampedColumn.Columns.Count); + Assert.Equal(dfColumns, clampedColumns); + for (int c = 0; c < df.Columns.Count; c++) + { + DataFrameColumn column = clampedColumn.Columns[c]; + if (column.IsNumericColumn()) + { + for (int i = 0; i < 4; i++) + { + Assert.Equal("3", column[i].ToString()); + } + Assert.Equal(4.ToString(), column[4].ToString()); + Assert.Null(column[5]); + Assert.Equal(6.ToString(), column[6].ToString()); + for (int i = 7; i < 10; i++) + { + Assert.Equal("7", column[i].ToString()); + } + } + else + { + for (int i = 0; i < column.Length; i++) + { + var colD = df.Columns[c][i]; + var ocD = column[i]; + Assert.Equal(df.Columns[c][i], column[i]); + } + } + } + } + + // Out of place + DataFrame clamped = df.Clamp(3, 7); + VerifyDataFrameClamp(clamped); + for (int i = 0; i < 10; i++) + { + if (i != 5) + Assert.Equal(i, df.Columns["Int"][i]); + else + Assert.Null(df.Columns["Int"][5]); + } + + // Inplace + df.Clamp(3, 7, true); + VerifyDataFrameClamp(df); + + } + + [Fact] + public void TestDataFrameFilter() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); + DataFrame boolColumnFiltered = df[df.Columns["Bool"].ElementwiseEquals(true)]; + List verify = new List { 0, 2, 4, 6, 8 }; + Assert.Equal(5, boolColumnFiltered.Rows.Count); + for (int i = 0; i < boolColumnFiltered.Columns.Count; i++) + { + DataFrameColumn column = boolColumnFiltered.Columns[i]; + if (column.Name == "Char" || column.Name == "Bool" || column.Name == "String") + continue; + for (int j = 0; j < column.Length; j++) + { + Assert.Equal(verify[j].ToString(), column[j].ToString()); + } + } + DataFrame intEnumerableFiltered = df[Enumerable.Range(0, 10)]; + DataFrame boolEnumerableFiltered = df[Enumerable.Range(0, 10).Select(x => true)]; + DataFrame longEnumerableFiltered = df[Enumerable.Range(0, 10).Select(x => (long)x)]; + Assert.Equal(intEnumerableFiltered.Columns.Count, df.Columns.Count); + Assert.Equal(boolEnumerableFiltered.Columns.Count, df.Columns.Count); + Assert.Equal(longEnumerableFiltered.Columns.Count, df.Columns.Count); + for (int i = 0; i < intEnumerableFiltered.Columns.Count; i++) + { + DataFrameColumn intFilteredColumn = intEnumerableFiltered.Columns[i]; + DataFrameColumn dfColumn = df.Columns[i]; + DataFrameColumn boolFilteredColumn = boolEnumerableFiltered.Columns[i]; + DataFrameColumn longFilteredColumn = longEnumerableFiltered.Columns[i]; + Assert.True(intFilteredColumn.ElementwiseEquals(dfColumn).All()); + Assert.True(boolFilteredColumn.ElementwiseEquals(dfColumn).All()); + Assert.True(longFilteredColumn.ElementwiseEquals(dfColumn).All()); + } + } + + [Fact] + public void TestPrefixAndSuffix() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + IEnumerable columnNames = ((IDataView)df).Schema; + + DataFrame prefix = df.AddPrefix("Prefix_"); + IEnumerable prefixNames = ((IDataView)prefix).Schema; + foreach ((DataViewSchema.Column First, DataViewSchema.Column Second) in columnNames.Zip(((IDataView)df).Schema, (e1, e2) => (e1, e2))) + { + Assert.Equal(First.Name, Second.Name); + } + foreach ((DataViewSchema.Column First, DataViewSchema.Column Second) in prefixNames.Zip(columnNames, (e1, e2) => (e1, e2))) + { + Assert.Equal(First.Name, "Prefix_" + Second.Name); + } + + // Inplace + df.AddPrefix("Prefix_", true); + prefixNames = ((IDataView)df).Schema; + foreach ((DataViewSchema.Column First, DataViewSchema.Column Second) in columnNames.Zip(prefixNames, (e1, e2) => (e1, e2))) + { + Assert.Equal("Prefix_" + First.Name, Second.Name); + } + + DataFrame suffix = df.AddSuffix("_Suffix"); + IEnumerable suffixNames = ((IDataView)suffix).Schema; + foreach ((DataViewSchema.Column First, DataViewSchema.Column Second) in ((IDataView)df).Schema.Zip(columnNames, (e1, e2) => (e1, e2))) + { + Assert.Equal(First.Name, "Prefix_" + Second.Name); + } + foreach ((DataViewSchema.Column First, DataViewSchema.Column Second) in columnNames.Zip(suffixNames, (e1, e2) => (e1, e2))) + { + Assert.Equal("Prefix_" + First.Name + "_Suffix", Second.Name); + } + + // InPlace + df.AddSuffix("_Suffix", true); + suffixNames = ((IDataView)df).Schema; + foreach ((DataViewSchema.Column First, DataViewSchema.Column Second) in columnNames.Zip(suffixNames, (e1, e2) => (e1, e2))) + { + Assert.Equal("Prefix_" + First.Name + "_Suffix", Second.Name); + } + } + + [Fact] + public void TestSample() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + DataFrame sampled = df.Sample(7); + Assert.Equal(7, sampled.Rows.Count); + Assert.Equal(df.Columns.Count, sampled.Columns.Count); + + // all sampled rows should be unique. + HashSet uniqueRowValues = new HashSet(); + foreach(int? value in sampled.Columns["Int"]) + { + uniqueRowValues.Add(value); + } + Assert.Equal(uniqueRowValues.Count, sampled.Rows.Count); + + // should throw exception as sample size is greater than dataframe rows + Assert.Throws(()=> df.Sample(13)); + } + + [Fact] + public void TestMerge() + { + DataFrame left = MakeDataFrameWithAllMutableColumnTypes(10); + DataFrame right = MakeDataFrameWithAllMutableColumnTypes(5); + + // Tests with right.Rows.Count < left.Rows.Count + // Left merge + DataFrame merge = left.Merge(right, "Int", "Int"); + Assert.Equal(10, merge.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Null(merge.Columns["Int_right"][6]); + Assert.Null(merge.Columns["Int_left"][5]); + VerifyMerge(merge, left, right, JoinAlgorithm.Left); + + // Right merge + merge = left.Merge(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Right); + Assert.Equal(5, merge.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(merge.Columns["Int_right"][3], right.Columns["Int"][3]); + Assert.Null(merge.Columns["Int_right"][2]); + VerifyMerge(merge, left, right, JoinAlgorithm.Right); + + // Outer merge + merge = left.Merge(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.FullOuter); + Assert.Equal(merge.Rows.Count, left.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Null(merge.Columns["Int_right"][6]); + VerifyMerge(merge, left, right, JoinAlgorithm.FullOuter); + + // Inner merge + merge = left.Merge(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Inner); + Assert.Equal(merge.Rows.Count, right.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(merge.Columns["Int_right"][2], right.Columns["Int"][3]); + Assert.Null(merge.Columns["Int_right"][4]); + VerifyMerge(merge, left, right, JoinAlgorithm.Inner); + + // Tests with right.Rows.Count > left.Rows.Count + // Left merge + right = MakeDataFrameWithAllMutableColumnTypes(15); + merge = left.Merge(right, "Int", "Int"); + Assert.Equal(merge.Rows.Count, left.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(merge.Columns["Int_right"][6], right.Columns["Int"][6]); + VerifyMerge(merge, left, right, JoinAlgorithm.Left); + + // Right merge + merge = left.Merge(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Right); + Assert.Equal(merge.Rows.Count, right.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(merge.Columns["Int_right"][2], right.Columns["Int"][2]); + Assert.Null(merge.Columns["Int_left"][12]); + VerifyMerge(merge, left, right, JoinAlgorithm.Right); + + // Outer merge + merge = left.Merge(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.FullOuter); + Assert.Equal(16, merge.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Null(merge.Columns["Int_left"][12]); + Assert.Null(merge.Columns["Int_left"][5]); + VerifyMerge(merge, left, right, JoinAlgorithm.FullOuter); + + // Inner merge + merge = left.Merge(right, "Int", "Int", joinAlgorithm: JoinAlgorithm.Inner); + Assert.Equal(9, merge.Rows.Count); + Assert.Equal(merge.Columns.Count, left.Columns.Count + right.Columns.Count); + Assert.Equal(merge.Columns["Int_right"][2], right.Columns["Int"][2]); + VerifyMerge(merge, left, right, JoinAlgorithm.Inner); + } + + [Fact] + public void TestDescription() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); + + // Add a column manually here until we fix https://github.com/dotnet/corefxlab/issues/2784 + PrimitiveDataFrameColumn dateTimes = new PrimitiveDataFrameColumn("DateTimes"); + for (int i = 0; i < 10; i++) + { + dateTimes.Append(DateTime.Parse("2019/01/01")); + } + df.Columns.Add(dateTimes); + + DataFrame description = df.Description(); + DataFrameColumn descriptionColumn = description.Columns[0]; + Assert.Equal("Description", descriptionColumn.Name); + Assert.Equal("Length (excluding null values)", descriptionColumn[0]); + Assert.Equal("Max", descriptionColumn[1]); + Assert.Equal("Min", descriptionColumn[2]); + Assert.Equal("Mean", descriptionColumn[3]); + for (int i = 1; i < description.Columns.Count - 1; i++) + { + DataFrameColumn column = description.Columns[i]; + Assert.Equal(df.Columns[i - 1].Name, column.Name); + Assert.Equal(4, column.Length); + Assert.Equal((float)9, column[0]); + Assert.Equal((float)9, column[1]); + Assert.Equal((float)0, column[2]); + Assert.Equal((float)4, column[3]); + } + + // Explicitly check the dateTimes column + DataFrameColumn dateTimeColumn = description.Columns[description.Columns.Count - 1]; + Assert.Equal(dateTimeColumn.Name, dateTimes.Name); + Assert.Equal(4, dateTimeColumn.Length); + Assert.Equal((float)10, dateTimeColumn[0]); + Assert.Null(dateTimeColumn[1]); + Assert.Null(dateTimeColumn[2]); + Assert.Null(dateTimeColumn[3]); + } + + [Fact] + public void TestInfo() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(10); + + // Add a column manually here until we fix https://github.com/dotnet/corefxlab/issues/2784 + PrimitiveDataFrameColumn dateTimes = new PrimitiveDataFrameColumn("DateTimes"); + for (int i = 0; i < 10; i++) + { + dateTimes.Append(DateTime.Parse("2019/01/01")); + } + df.Columns.Add(dateTimes); + + DataFrame Info = df.Info(); + DataFrameColumn infoColumn = Info.Columns[0]; + Assert.Equal("Info", infoColumn.Name); + Assert.Equal("Length (excluding null values)", infoColumn[1]); + Assert.Equal("DataType", infoColumn[0]); + + for (int i = 1; i < Info.Columns.Count; i++) + { + DataFrameColumn column = Info.Columns[i]; + Assert.Equal(df.Columns[i - 1].DataType.ToString(), column[0].ToString()); + Assert.Equal(2, column.Length); + } + } + + [Fact] + public void TestDropNulls() + { + DataFrame df = MakeDataFrameWithAllMutableColumnTypes(20); + DataFrame anyNulls = df.DropNulls(); + Assert.Equal(19, anyNulls.Rows.Count); + + DataFrame allNulls = df.DropNulls(DropNullOptions.All); + Assert.Equal(19, allNulls.Rows.Count); + } + + [Fact] + public void TestInsertMismatchedColumnToEmptyDataFrame() + { + DataFrame df = new DataFrame(); + DataFrameColumn dataFrameColumn1 = new Int32DataFrameColumn("Int1"); + df.Columns.Insert(0, dataFrameColumn1); + + // should throw exception as column sizes are mismatched. + + Assert.Throws(() => df.Columns.Insert(1, new Int32DataFrameColumn("Int2", Enumerable.Range(0, 5).Select(x => x)))); + } + + [Fact] + public void TestFillNulls() + { + DataFrame df = MakeDataFrameWithTwoColumns(20); + Assert.Null(df[10, 0]); + DataFrame fillNulls = df.FillNulls(1000); + Assert.Equal(1000, (int)fillNulls[10, 1]); + Assert.Null(df[10, 0]); + df.FillNulls(1000, true); + Assert.Equal(1000, df[10, 1]); + + StringDataFrameColumn strColumn = new StringDataFrameColumn("String", 0); + strColumn.Append(null); + strColumn.Append(null); + Assert.Equal(2, strColumn.Length); + Assert.Equal(2, strColumn.NullCount); + DataFrameColumn filled = strColumn.FillNulls("foo"); + Assert.Equal(2, strColumn.Length); + Assert.Equal(2, strColumn.NullCount); + Assert.Equal(2, filled.Length); + Assert.Equal(0, filled.NullCount); + Assert.Equal("foo", filled[0]); + Assert.Equal("foo", filled[1]); + Assert.Null(strColumn[0]); + Assert.Null(strColumn[1]); + + // In place + strColumn.FillNulls("foo", true); + Assert.Equal(2, strColumn.Length); + Assert.Equal(0, strColumn.NullCount); + Assert.Equal("foo", strColumn[0]); + Assert.Equal("foo", strColumn[1]); + + // ArrowStringColumn (not inplace) + ArrowStringDataFrameColumn arrowColumn = CreateArrowStringColumn(3); + Assert.Equal(3, arrowColumn.Length); + Assert.Equal(1, arrowColumn.NullCount); + Assert.Null(arrowColumn[1]); + ArrowStringDataFrameColumn arrowColumnFilled = arrowColumn.FillNulls("foo"); + Assert.Equal(3, arrowColumn.Length); + Assert.Equal(1, arrowColumn.NullCount); + Assert.Equal(3, arrowColumnFilled.Length); + Assert.Equal(0, arrowColumnFilled.NullCount); + Assert.Equal("foo", arrowColumnFilled[1]); + Assert.Equal(arrowColumn[0], arrowColumnFilled[0]); + Assert.Equal(arrowColumn[2], arrowColumnFilled[2]); + } + + [Fact] + public void TestValueCounts() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10, withNulls: false); + DataFrame valueCounts = df.Columns["Bool"].ValueCounts(); + Assert.Equal(2, valueCounts.Rows.Count); + Assert.Equal((long)5, valueCounts.Columns["Counts"][0]); + Assert.Equal((long)5, valueCounts.Columns["Counts"][1]); + } + + [Fact] + public void TestApplyElementwiseNullCount() + { + DataFrame df = MakeDataFrameWithTwoColumns(10); + Int32DataFrameColumn column = df.Columns["Int1"] as Int32DataFrameColumn; + Assert.Equal(1, column.NullCount); + + // Change all existing values to null + column.ApplyElementwise((int? value, long rowIndex) => + { + if (!(value is null)) + return null; + return value; + }); + Assert.Equal(column.Length, column.NullCount); + + // Don't change null values + column.ApplyElementwise((int? value, long rowIndex) => + { + return value; + }); + Assert.Equal(column.Length, column.NullCount); + + // Change all null values to real values + column.ApplyElementwise((int? value, long rowIndex) => + { + return 5; + }); + Assert.Equal(0, column.NullCount); + + // Don't change real values + column.ApplyElementwise((int? value, long rowIndex) => + { + return value; + }); + Assert.Equal(0, column.NullCount); + + } + + [Theory] + [InlineData(10, 5)] + [InlineData(20, 20)] + public void TestClone(int dfLength, int intDfLength) + { + DataFrame df = MakeDataFrameWithAllColumnTypes(dfLength, withNulls: true); + DataFrame intDf = MakeDataFrameWithTwoColumns(intDfLength, false); + Int32DataFrameColumn intColumn = intDf.Columns["Int1"] as Int32DataFrameColumn; + DataFrame clone = df[intColumn]; + Assert.Equal(intDfLength, clone.Rows.Count); + Assert.Equal(df.Columns.Count, clone.Columns.Count); + for (int i = 0; i < df.Columns.Count; i++) + { + DataFrameColumn dfColumn = df.Columns[i]; + DataFrameColumn cloneColumn = clone.Columns[i]; + for (long r = 0; r < clone.Rows.Count; r++) + { + Assert.Equal(dfColumn[r], cloneColumn[r]); + } + } + } + + [Fact] + public void TestColumnCreationFromExisitingColumn() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + BooleanDataFrameColumn bigInts = new BooleanDataFrameColumn("BigInts", df.Columns["Int"].ElementwiseGreaterThan(5)); + for (int i = 0; i < 10; i++) + { + if (i <= 5) + Assert.False(bigInts[i]); + else + Assert.True(bigInts[i]); + } + } + + [Fact] + public void TestColumns() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + IReadOnlyList columns = df.Columns; + int i = 0; + Assert.Equal(columns.Count, df.Columns.Count); + foreach (DataFrameColumn dataFrameColumn in columns) + { + Assert.Equal(dataFrameColumn, df.Columns[i++]); + } + + } + + [Fact] + public void TestRows() + { + DataFrame df = MakeDataFrameWithAllColumnTypes(10); + DataFrameRowCollection rows = df.Rows; + Assert.Equal(10, rows.Count); + DataFrameRow firstRow = rows[0]; + object firstValue = firstRow[0]; + Assert.Equal(df[0, 0], firstValue); + long rowCount = 0; + foreach (DataFrameRow row in rows) + { + int columnIndex = 0; + foreach (var value in row) + { + Assert.Equal(df.Columns[columnIndex][rowCount], value); + columnIndex++; + } + rowCount++; + } + Assert.Equal(df.Rows.Count, rowCount); + + DataFrameRow nullRow = rows[5]; + int intColumnIndex = df.Columns.IndexOf("Int"); + Assert.Equal(1, df.Columns[intColumnIndex].NullCount); + nullRow[intColumnIndex] = 5; + Assert.Equal(0, df.Columns[intColumnIndex].NullCount); + nullRow[intColumnIndex] = null; + Assert.Equal(1, df.Columns[intColumnIndex].NullCount); + } + + [Fact] + public void TestMutationOnRows() + { + DataFrame df = MakeDataFrameWithNumericColumns(10); + DataFrameRowCollection rows = df.Rows; + + foreach (DataFrameRow row in rows) + { + for (int i = 0; i < df.Columns.Count; i++) + { + DataFrameColumn column = df.Columns[i]; + row[i] = Convert.ChangeType(12, column.DataType); + } + } + + foreach (var column in df.Columns) + { + foreach (var value in column) + { + Assert.Equal("12", value.ToString()); + } + } + } + + [Fact] + public void TestAppendRows() + { + DataFrame df = MakeDataFrame(10); + DataFrame df2 = MakeDataFrame(5); + Assert.Equal(10, df.Rows.Count); + Assert.Equal(1, df.Columns[0].NullCount); + Assert.Equal(1, df.Columns[1].NullCount); + + DataFrame ret = df.Append(df2.Rows, inPlace: false); + Assert.Equal(10, df.Rows.Count); + Assert.Equal(1, df.Columns[0].NullCount); + Assert.Equal(1, df.Columns[1].NullCount); + + Verify(ret, df, df2); + + void Verify(DataFrame ret, DataFrame check1, DataFrame check2) + { + Assert.Equal(15, ret.Rows.Count); + Assert.Equal(2, ret.Columns[0].NullCount); + Assert.Equal(2, ret.Columns[1].NullCount); + for (long i = 0; i < ret.Rows.Count; i++) + { + DataFrameRow row = ret.Rows[i]; + for (int j = 0; j < check1.Columns.Count; j++) + { + if (i < check1.Rows.Count) + { + Assert.Equal(row[j], check1.Rows[i][j]); + } + else + { + Assert.Equal(row[j]?.ToString(), (check2.Rows[i - check1.Rows.Count][j])?.ToString()); + } + } + } + } + + DataFrame dfClone = df.Clone(); + df.Append(df2.Rows, inPlace: true); + Verify(df, dfClone, df2); + } + + [Fact] + public void TestAppendRow() + { + DataFrame df = MakeDataFrame(10); + df.Append(new List { 5, true }, inPlace: true); + Assert.Equal(11, df.Rows.Count); + Assert.Equal(1, df.Columns[0].NullCount); + Assert.Equal(1, df.Columns[1].NullCount); + + DataFrame ret = df.Append(new List { 5, true }); + Assert.Equal(12, ret.Rows.Count); + Assert.Equal(1, ret.Columns[0].NullCount); + Assert.Equal(1, ret.Columns[1].NullCount); + + df.Append(new List { 100 }, inPlace: true); + Assert.Equal(12, df.Rows.Count); + Assert.Equal(1, df.Columns[0].NullCount); + Assert.Equal(2, df.Columns[1].NullCount); + + ret = df.Append(new List { 100 }, inPlace: false); + Assert.Equal(13, ret.Rows.Count); + Assert.Equal(1, ret.Columns[0].NullCount); + Assert.Equal(3, ret.Columns[1].NullCount); + + df.Append(new List { null, null }, inPlace: true); + Assert.Equal(13, df.Rows.Count); + Assert.Equal(2, df.Columns[0].NullCount); + Assert.Equal(3, df.Columns[1].NullCount); + ret = df.Append(new List { null, null }, inPlace: false); + Assert.Equal(14, ret.Rows.Count); + Assert.Equal(3, ret.Columns[0].NullCount); + Assert.Equal(4, ret.Columns[1].NullCount); + + df.Append(new Dictionary { { "Column1", (object)5 }, { "Column2", false } }, inPlace: true); + Assert.Equal(14, df.Rows.Count); + Assert.Equal(2, df.Columns[0].NullCount); + Assert.Equal(3, df.Columns[1].NullCount); + ret = df.Append(new Dictionary { { "Column1", (object)5 }, { "Column2", false } }, inPlace: false); + Assert.Equal(15, ret.Rows.Count); + Assert.Equal(2, ret.Columns[0].NullCount); + Assert.Equal(3, ret.Columns[1].NullCount); + + df.Append(new Dictionary { { "Column1", 5 } }, inPlace: true); + Assert.Equal(15, df.Rows.Count); + + Assert.Equal(15, df.Columns["Column1"].Length); + Assert.Equal(15, df.Columns["Column2"].Length); + Assert.Equal(2, df.Columns[0].NullCount); + Assert.Equal(4, df.Columns[1].NullCount); + ret = df.Append(new Dictionary { { "Column1", 5 } }, inPlace: false); + Assert.Equal(16, ret.Rows.Count); + + Assert.Equal(16, ret.Columns["Column1"].Length); + Assert.Equal(16, ret.Columns["Column2"].Length); + Assert.Equal(2, ret.Columns[0].NullCount); + Assert.Equal(5, ret.Columns[1].NullCount); + + df.Append(new Dictionary { { "Column2", false } }, inPlace: true); + Assert.Equal(16, df.Rows.Count); + Assert.Equal(16, df.Columns["Column1"].Length); + Assert.Equal(16, df.Columns["Column2"].Length); + Assert.Equal(3, df.Columns[0].NullCount); + Assert.Equal(4, df.Columns[1].NullCount); + ret = df.Append(new Dictionary { { "Column2", false } }, inPlace: false); + Assert.Equal(17, ret.Rows.Count); + Assert.Equal(17, ret.Columns["Column1"].Length); + Assert.Equal(17, ret.Columns["Column2"].Length); + Assert.Equal(4, ret.Columns[0].NullCount); + Assert.Equal(4, ret.Columns[1].NullCount); + + df.Append((IEnumerable)null, inPlace: true); + Assert.Equal(17, df.Rows.Count); + Assert.Equal(17, df.Columns["Column1"].Length); + Assert.Equal(17, df.Columns["Column2"].Length); + Assert.Equal(4, df.Columns[0].NullCount); + Assert.Equal(5, df.Columns[1].NullCount); + ret = df.Append((IEnumerable)null, inPlace: false); + Assert.Equal(18, ret.Rows.Count); + Assert.Equal(18, ret.Columns["Column1"].Length); + Assert.Equal(18, ret.Columns["Column2"].Length); + Assert.Equal(5, ret.Columns[0].NullCount); + Assert.Equal(6, ret.Columns[1].NullCount); + + // DataFrame must remain usable even if Append throws + Assert.Throws(() => df.Append(new List { 5, "str" }, inPlace: true)); + Assert.Throws(() => df.Append(new Dictionary { { "Column2", "str" } }, inPlace: true)); + Assert.Throws(() => df.Append(new List { 5, true, true }, inPlace: true)); + + df.Append(inPlace: true); + Assert.Equal(18, df.Rows.Count); + Assert.Equal(18, df.Columns["Column1"].Length); + Assert.Equal(18, df.Columns["Column2"].Length); + Assert.Equal(5, df.Columns[0].NullCount); + Assert.Equal(6, df.Columns[1].NullCount); + + ret = df.Append(inPlace: false); + Assert.Equal(18, df.Rows.Count); + Assert.Equal(18, df.Columns["Column1"].Length); + Assert.Equal(18, df.Columns["Column2"].Length); + Assert.Equal(5, df.Columns[0].NullCount); + Assert.Equal(6, df.Columns[1].NullCount); + Assert.Equal(19, ret.Rows.Count); + Assert.Equal(19, ret.Columns["Column1"].Length); + Assert.Equal(19, ret.Columns["Column2"].Length); + Assert.Equal(6, ret.Columns[0].NullCount); + Assert.Equal(7, ret.Columns[1].NullCount); + } + + [Fact] + public void TestAppendEmptyValue() + { + DataFrame df = MakeDataFrame(10); + df.Append(new List { "", true }, inPlace: true); + Assert.Equal(11, df.Rows.Count); + Assert.Equal(2, df.Columns[0].NullCount); + Assert.Equal(1, df.Columns[1].NullCount); + + StringDataFrameColumn column = new StringDataFrameColumn("Strings", Enumerable.Range(0, 11).Select(x => x.ToString())); + df.Columns.Add(column); + + df.Append(new List { 1, true, "" }, inPlace: true); + Assert.Equal(12, df.Rows.Count); + Assert.Equal(2, df.Columns[0].NullCount); + Assert.Equal(1, df.Columns[1].NullCount); + Assert.Equal(0, df.Columns[2].NullCount); + + df.Append(new List { 1, true, null }, inPlace: true); + Assert.Equal(13, df.Rows.Count); + Assert.Equal(1, df.Columns[2].NullCount); + } + + [Fact] + public void TestApply() + { + int[] values = { 1, 2, 3, 4, 5 }; + var col = new Int32DataFrameColumn("Ints", values); + PrimitiveDataFrameColumn newCol = col.Apply(i => i + 0.5d); + + Assert.Equal(values.Length, newCol.Length); + + for (int i = 0; i < newCol.Length; i++) + { + Assert.Equal(col[i], values[i]); // Make sure values didn't change + Assert.Equal(newCol[i], values[i] + 0.5d); + } + } + + [Fact] + public void TestDataFrameCreate() + { + int length = 10; + void AssertLengthTypeAndValues(DataFrameColumn column, Type type) + { + Assert.Equal(column.DataType, type); + Assert.Equal(length, column.Length); + for (long i = 0; i < column.Length; i++) + { + Assert.Equal(i.ToString(), column[i].ToString()); + } + } + DataFrameColumn stringColumn = DataFrameColumn.Create("String", Enumerable.Range(0, length).Select(x => x.ToString())); + AssertLengthTypeAndValues(stringColumn, typeof(string)); + DataFrameColumn byteColumn = DataFrameColumn.Create("Byte", Enumerable.Range(0, length).Select(x => (byte)x)); + AssertLengthTypeAndValues(byteColumn, typeof(byte)); + DataFrameColumn decimalColumn = DataFrameColumn.Create("Decimal", Enumerable.Range(0, length).Select(x => (decimal)x)); + AssertLengthTypeAndValues(decimalColumn, typeof(decimal)); + DataFrameColumn doubleColumn = DataFrameColumn.Create("Double", Enumerable.Range(0, length).Select(x => (double)x)); + AssertLengthTypeAndValues(doubleColumn, typeof(double)); + DataFrameColumn floatColumn = DataFrameColumn.Create("Float", Enumerable.Range(0, length).Select(x => (float)x)); + AssertLengthTypeAndValues(floatColumn, typeof(float)); + DataFrameColumn intColumn = DataFrameColumn.Create("Int", Enumerable.Range(0, length).Select(x => x)); + AssertLengthTypeAndValues(intColumn, typeof(int)); + DataFrameColumn longColumn = DataFrameColumn.Create("Long", Enumerable.Range(0, length).Select(x => (long)x)); + AssertLengthTypeAndValues(longColumn, typeof(long)); + DataFrameColumn sbyteColumn = DataFrameColumn.Create("Sbyte", Enumerable.Range(0, length).Select(x => (sbyte)x)); + AssertLengthTypeAndValues(sbyteColumn, typeof(sbyte)); + DataFrameColumn shortColumn = DataFrameColumn.Create("Short", Enumerable.Range(0, length).Select(x => (short)x)); + AssertLengthTypeAndValues(shortColumn, typeof(short)); + DataFrameColumn uintColumn = DataFrameColumn.Create("Uint", Enumerable.Range(0, length).Select(x => (uint)x)); + AssertLengthTypeAndValues(uintColumn, typeof(uint)); + DataFrameColumn ulongColumn = DataFrameColumn.Create("Ulong", Enumerable.Range(0, length).Select(x => (ulong)x)); + AssertLengthTypeAndValues(ulongColumn, typeof(ulong)); + DataFrameColumn ushortColumn = DataFrameColumn.Create("Ushort", Enumerable.Range(0, length).Select(x => (ushort)x)); + AssertLengthTypeAndValues(ushortColumn, typeof(ushort)); + } + + [Fact] + public void TestBinaryOperationsOnExplodedNumericColumns() + { + DataFrame df = MakeDataFrameWithNumericAndBoolColumns(10, withNulls: false); + Int32DataFrameColumn ints = df.Columns["Int"] as Int32DataFrameColumn; + Int32DataFrameColumn res = ints.Add(1).Subtract(1).Multiply(10).Divide(10).LeftShift(2).RightShift(2); + Assert.True(res.ElementwiseEquals(ints).All()); + Assert.True(res.ElementwiseGreaterThanOrEqual(ints).All()); + Assert.True(res.ElementwiseLessThanOrEqual(ints).All()); + Assert.False(res.ElementwiseNotEquals(ints).All()); + Assert.False(res.ElementwiseGreaterThan(ints).All()); + Assert.False(res.ElementwiseLessThan(ints).All()); + + // Test inPlace + Int32DataFrameColumn inPlace = ints.Add(1, inPlace: true).Subtract(1, inPlace: true).Multiply(10, inPlace: true).Divide(10, inPlace: true).LeftShift(2, inPlace: true).RightShift(2, inPlace: true).Add(100, inPlace: true); + Assert.True(inPlace.ElementwiseEquals(ints).All()); + Assert.True(inPlace.ElementwiseGreaterThanOrEqual(ints).All()); + Assert.True(inPlace.ElementwiseLessThanOrEqual(ints).All()); + Assert.False(inPlace.ElementwiseNotEquals(ints).All()); + Assert.False(inPlace.ElementwiseGreaterThan(ints).All()); + Assert.False(inPlace.ElementwiseLessThan(ints).All()); + + Assert.False(inPlace.ElementwiseEquals(res).All()); + Assert.True(inPlace.ElementwiseGreaterThanOrEqual(res).All()); + Assert.False(inPlace.ElementwiseLessThanOrEqual(res).All()); + Assert.True(inPlace.ElementwiseNotEquals(res).All()); + Assert.True(inPlace.ElementwiseGreaterThan(res).All()); + Assert.False(inPlace.ElementwiseLessThan(res).All()); + + // Test Bool column + BooleanDataFrameColumn bools = df.Columns["Bool"] as BooleanDataFrameColumn; + BooleanDataFrameColumn allFalse = bools.Or(true).And(true).Xor(true); + Assert.True(allFalse.ElementwiseEquals(false).All()); + + // Test inPlace + BooleanDataFrameColumn inPlaceAllFalse = bools.Or(true, inPlace: true).And(true, inPlace: true).Xor(true, inPlace: true); + Assert.True(inPlaceAllFalse.ElementwiseEquals(bools).All()); + + // Test Reverse Operations + Int32DataFrameColumn reverse = ints.ReverseAdd(1).ReverseSubtract(1).ReverseMultiply(-1); + Assert.True(reverse.ElementwiseEquals(ints).All()); + + // Test inPlace + Int32DataFrameColumn reverseInPlace = ints.ReverseAdd(1, inPlace: true).ReverseSubtract(1, inPlace: true).ReverseMultiply(-1, inPlace: true).ReverseDivide(100, inPlace: true); + Assert.True(reverseInPlace.ElementwiseEquals(ints).All()); + Assert.False(reverseInPlace.ElementwiseEquals(reverse).All()); + } + + [Fact] + public void TestArrowStringApply() + { + ArrowStringDataFrameColumn column = CreateArrowStringColumn(10); + ArrowStringDataFrameColumn ret = column.Apply((string cur) => + { + if (cur != null) + { + return cur + "123"; + } + return null; + }); + for (long i = 0; i < column.Length; i++) + { + if (column[i] != null) + { + Assert.Equal(column[i] + "123", ret[i]); + } + else + { + Assert.Null(ret[i]); + } + } + Assert.Equal(1, ret.NullCount); + + // Test null counts + ret = column.Apply((string cur) => + { + return null; + }); + Assert.Equal(column.Length, ret.NullCount); + } + + [Fact] + public void GetColumnTests() + { + DataFrame dataFrame = MakeDataFrameWithAllColumnTypes(10); + PrimitiveDataFrameColumn primitiveInts = dataFrame.Columns.GetPrimitiveColumn("Int"); + Assert.NotNull(primitiveInts); + Assert.Throws(() => dataFrame.Columns.GetPrimitiveColumn("Int")); + + StringDataFrameColumn strings = dataFrame.Columns.GetStringColumn("String"); + Assert.NotNull(strings); + Assert.Throws(() => dataFrame.Columns.GetStringColumn("ArrowString")); + + ArrowStringDataFrameColumn arrowStrings = dataFrame.Columns.GetArrowStringColumn("ArrowString"); + Assert.NotNull(arrowStrings); + Assert.Throws(() => dataFrame.Columns.GetArrowStringColumn("String")); + + ByteDataFrameColumn bytes = dataFrame.Columns.GetByteColumn("Byte"); + Assert.NotNull(bytes); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Byte")); + + Int32DataFrameColumn ints = dataFrame.Columns.GetInt32Column("Int"); + Assert.NotNull(ints); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Int")); + + BooleanDataFrameColumn bools = dataFrame.Columns.GetBooleanColumn("Bool"); + Assert.NotNull(bools); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Bool")); + + CharDataFrameColumn chars = dataFrame.Columns.GetCharColumn("Char"); + Assert.NotNull(chars); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Char")); + + DecimalDataFrameColumn decimals = dataFrame.Columns.GetDecimalColumn("Decimal"); + Assert.NotNull(decimals); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Decimal")); + + DoubleDataFrameColumn doubles = dataFrame.Columns.GetDoubleColumn("Double"); + Assert.NotNull(doubles); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Double")); + + SingleDataFrameColumn singles = dataFrame.Columns.GetSingleColumn("Float"); + Assert.NotNull(singles); + Assert.Throws(() => dataFrame.Columns.GetDoubleColumn("Float")); + + Int64DataFrameColumn longs = dataFrame.Columns.GetInt64Column("Long"); + Assert.NotNull(longs); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Long")); + + SByteDataFrameColumn sbytes = dataFrame.Columns.GetSByteColumn("Sbyte"); + Assert.NotNull(sbytes); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Sbyte")); + + Int16DataFrameColumn shorts = dataFrame.Columns.GetInt16Column("Short"); + Assert.NotNull(shorts); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Short")); + + UInt32DataFrameColumn uints = dataFrame.Columns.GetUInt32Column("Uint"); + Assert.NotNull(uints); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Uint")); + + UInt64DataFrameColumn ulongs = dataFrame.Columns.GetUInt64Column("Ulong"); + Assert.NotNull(ulongs); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Ulong")); + + UInt16DataFrameColumn ushorts = dataFrame.Columns.GetUInt16Column("Ushort"); + Assert.NotNull(ushorts); + Assert.Throws(() => dataFrame.Columns.GetSingleColumn("Ushort")); + + } + } +} diff --git a/test/Microsoft.Data.Analysis.Tests/Microsoft.Data.Analysis.Tests.csproj b/test/Microsoft.Data.Analysis.Tests/Microsoft.Data.Analysis.Tests.csproj new file mode 100644 index 0000000000..2b6f43253f --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/Microsoft.Data.Analysis.Tests.csproj @@ -0,0 +1,31 @@ + + + $(NoWarn);MSML_ParameterLocalVarName;MSML_PrivateFieldName;MSML_ExtendBaseTestClass;MSML_GeneralName + + + + + + + + + + + + TextTemplatingFileGenerator + DataFrameColumn.BinaryOperationTests.cs + + + + + + + + + + True + True + DataFrameColumn.BinaryOperationTests.tt + + + diff --git a/test/Microsoft.Data.Analysis.Tests/TextFieldParserTests.cs b/test/Microsoft.Data.Analysis.Tests/TextFieldParserTests.cs new file mode 100644 index 0000000000..96ac2d4787 --- /dev/null +++ b/test/Microsoft.Data.Analysis.Tests/TextFieldParserTests.cs @@ -0,0 +1,168 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.IO; +using System.Text; +using Xunit; + +namespace Microsoft.Data.Analysis.Tests +{ + public class TextFieldParserTests + { + private Stream GetStream(string streamData) + { + return new MemoryStream(Encoding.Default.GetBytes(streamData)); + } + + [Fact] + public void Constructors() + { + string data = @"abc123"; + + // public TextFieldParser(System.IO.Stream stream) + using (var stream = GetStream(data)) + { + using (var parser = new TextFieldParser(stream)) + { + } + Assert.Throws(() => stream.ReadByte()); + } + + // public TextFieldParser(System.IO.Stream stream, System.Text.Encoding defaultEncoding, bool detectEncoding, bool leaveOpen); + using (var stream = GetStream(data)) + { + using (var parser = new TextFieldParser(stream, defaultEncoding: Encoding.Unicode, detectEncoding: true, leaveOpen: true)) + { + } + _ = stream.ReadByte(); + } + + // public TextFieldParser(System.IO.TextReader reader) + using (var reader = new StreamReader(GetStream(data))) + { + using (var parser = new TextFieldParser(reader)) + { + } + Assert.Throws(() => reader.ReadToEnd()); + } + } + + [Fact] + public void Close() + { + string data = @"abc123"; + using (var stream = GetStream(data)) + { + using (var parser = new TextFieldParser(stream)) + { + parser.Close(); + } + } + + using (var parser = new TextFieldParser(GetStream(data))) + { + parser.Close(); + } + + { + var parser = new TextFieldParser(GetStream(data)); + parser.Close(); + parser.Close(); + } + + { + TextFieldParser parser; + using (parser = new TextFieldParser(GetStream(data))) + { + } + parser.Close(); + } + } + + [Fact] + public void Properties() + { + + string data = @"abc123"; + + using (var parser = new TextFieldParser(GetStream(data))) + { + Assert.Null(parser.CommentTokens); + parser.CommentTokens = new[] { "[", "]" }; + Assert.Equal(new[] { "[", "]" }, parser.CommentTokens); + + Assert.Null(parser.Delimiters); + parser.SetDelimiters(new[] { "A", "123" }); + Assert.Equal(new[] { "A", "123" }, parser.Delimiters); + parser.SetDelimiters(new[] { "123", "B" }); + Assert.Equal(new[] { "123", "B" }, parser.Delimiters); + + Assert.Null(parser.FieldWidths); + parser.SetFieldWidths(new[] { 1, 2, int.MaxValue }); + Assert.Equal(new[] { 1, 2, int.MaxValue }, parser.FieldWidths); + parser.SetFieldWidths(new[] { int.MaxValue, 3 }); + Assert.Equal(new[] { int.MaxValue, 3 }, parser.FieldWidths); + Assert.Throws(() => parser.SetFieldWidths(new[] { -1, -1 })); + + Assert.True(parser.HasFieldsEnclosedInQuotes); + parser.HasFieldsEnclosedInQuotes = false; + Assert.False(parser.HasFieldsEnclosedInQuotes); + + Assert.Equal(FieldType.Delimited, parser.TextFieldType); + parser.TextFieldType = FieldType.FixedWidth; + Assert.Equal(FieldType.FixedWidth, parser.TextFieldType); + + Assert.True(parser.TrimWhiteSpace); + parser.TrimWhiteSpace = false; + Assert.False(parser.TrimWhiteSpace); + } + } + + [Fact] + public void ReadLine_ReadToEnd() + { + string data = @"abc +123"; + + using (var parser = new TextFieldParser(GetStream(data))) + { + Assert.False(parser.EndOfData); + + Assert.Equal( +@"abc +123", + parser.ReadToEnd()); + Assert.Equal(-1, parser.LineNumber); + Assert.True(parser.EndOfData); + } + + using (var parser = new TextFieldParser(GetStream(data))) + { + Assert.Equal("abc", parser.ReadLine()); + Assert.Equal(2, parser.LineNumber); + Assert.False(parser.EndOfData); + + Assert.Equal("123", parser.ReadToEnd()); + Assert.Equal(-1, parser.LineNumber); + Assert.True(parser.EndOfData); + } + + using (var parser = new TextFieldParser(GetStream(data))) + { + Assert.Equal("abc", parser.ReadLine()); + Assert.Equal(2, parser.LineNumber); + Assert.False(parser.EndOfData); + + Assert.Equal("123", parser.ReadLine()); + Assert.Equal(-1, parser.LineNumber); + Assert.True(parser.EndOfData); + + Assert.Null(parser.ReadToEnd()); + Assert.Equal(-1, parser.LineNumber); + Assert.True(parser.EndOfData); + } + } + } +} diff --git a/test/Microsoft.Extensions.ML.Tests/Microsoft.Extensions.ML.Tests.csproj b/test/Microsoft.Extensions.ML.Tests/Microsoft.Extensions.ML.Tests.csproj index 377369de9b..2105028eea 100644 --- a/test/Microsoft.Extensions.ML.Tests/Microsoft.Extensions.ML.Tests.csproj +++ b/test/Microsoft.Extensions.ML.Tests/Microsoft.Extensions.ML.Tests.csproj @@ -12,6 +12,14 @@ + + + + + + + +