Skip to content

Commit 2366da2

Browse files
committed
Step 2
1 parent 94bca4e commit 2366da2

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ namespace Microsoft.Data.Analysis
2121
where T : unmanaged
2222
{
2323
<# foreach (MethodConfiguration method in methodConfiguration) { #>
24-
<# if (method.MethodType == MethodType.Comparison || method.MethodType == MethodType.ComparisonScalar) { #>
25-
PrimitiveColumnContainer<bool> <#=method.MethodName#>(<#=method.GetMethodArguments("PrimitiveColumnContainer", "T")#>);
24+
<# if (method.MethodType == MethodType.Comparison) { #>
25+
PrimitiveColumnContainer<bool> <#=method.MethodName#>(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right);
26+
<# } #>
27+
<# else if (method.MethodType == MethodType.ComparisonScalar) { #>
28+
PrimitiveColumnContainer<bool> <#=method.MethodName#>(PrimitiveColumnContainer<T> column, T scalar);
2629
<# } #>
2730
<# else if (method.MethodType == MethodType.Binary) { #>
2831
void <#=method.MethodName#>(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right);
@@ -61,15 +64,27 @@ namespace Microsoft.Data.Analysis
6164
internal class <#=type.ClassPrefix#>Arithmetic : IPrimitiveDataFrameColumnArithmetic<<#=type.TypeName#>>
6265
{
6366
<# foreach (MethodConfiguration method in methodConfiguration) { #>
64-
<# if (method.MethodType == MethodType.Comparison || method.MethodType == MethodType.ComparisonScalar) { #>
67+
<# if (method.MethodType == MethodType.Comparison) { #>
6568

66-
public PrimitiveColumnContainer<bool> <#=method.MethodName#>(<#=method.GetMethodArguments("PrimitiveColumnContainer", type.TypeName)#>)
67-
{
68-
<#} else {#>
69+
public PrimitiveColumnContainer<bool> <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> left, PrimitiveColumnContainer<<#=type.TypeName#>> right)
70+
<# } #>
71+
<# else if (method.MethodType == MethodType.ComparisonScalar) { #>
6972

70-
public void <#=method.MethodName#>(<#=method.GetMethodArguments("PrimitiveColumnContainer", type.TypeName)#>)
71-
{
73+
public PrimitiveColumnContainer<bool> <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, <#=type.TypeName#> scalar)
74+
<# } #>
75+
<# else if (method.MethodType == MethodType.Binary) { #>
76+
77+
public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> left, PrimitiveColumnContainer<<#=type.TypeName#>> right)
78+
<# } #>
79+
<# else if (method.MethodType == MethodType.BinaryScalar) { #>
80+
81+
public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, <#=type.TypeName#> scalar)
7282
<# } #>
83+
<# else if (method.MethodType == MethodType.BinaryInt) { #>
84+
85+
public void <#=method.MethodName#>(PrimitiveColumnContainer<<#=type.TypeName#>> column, int value)
86+
<# } #>
87+
{
7388
<# if ((method.IsNumeric && !type.SupportsNumeric) || (method.IsBitwise && !type.SupportsBitwise) || (type.UnsupportedMethods.Contains(method.MethodName))) { #>
7489
throw new NotSupportedException();
7590
<# } else if (method.Operator != null) { #>

0 commit comments

Comments
 (0)