From bfd73d89d74ca2cb6d42ada3db257e7a7be00270 Mon Sep 17 00:00:00 2001 From: Aleksei Smirnov Date: Tue, 6 Jun 2023 15:24:28 +0300 Subject: [PATCH 1/2] Fix dataframe arithmetics --- .../PrimitiveDataFrameColumnArithmetic.cs | 304 +++++++++--------- .../PrimitiveDataFrameColumnArithmetic.tt | 4 +- 2 files changed, 154 insertions(+), 154 deletions(-) diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs index 05a20ef719..0747832533 100644 --- a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs @@ -313,7 +313,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColu var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -324,7 +324,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, bool scalar var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -336,7 +336,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -347,7 +347,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, bool sca var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -714,7 +714,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColu var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -725,7 +725,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, byte scalar var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -737,7 +737,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -748,7 +748,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, byte sca var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -760,7 +760,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, P var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -771,7 +771,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -783,7 +783,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Prim var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -794,7 +794,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, by var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -806,7 +806,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -817,7 +817,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, byte s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -829,7 +829,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -840,7 +840,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, byte scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -1175,7 +1175,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColu var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -1186,7 +1186,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, char scalar var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -1198,7 +1198,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -1209,7 +1209,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, char sca var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -1221,7 +1221,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, P var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -1232,7 +1232,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -1244,7 +1244,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Prim var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -1255,7 +1255,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, ch var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -1267,7 +1267,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -1278,7 +1278,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, char s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -1290,7 +1290,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -1301,7 +1301,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, char scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -1545,7 +1545,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -1556,7 +1556,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, decimal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -1568,7 +1568,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primiti var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -1579,7 +1579,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, decim var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -1591,7 +1591,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -1602,7 +1602,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer colu var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -1614,7 +1614,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, P var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -1625,7 +1625,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -1637,7 +1637,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primi var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -1648,7 +1648,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, dec var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -1660,7 +1660,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -1671,7 +1671,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, decima var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -1915,7 +1915,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -1926,7 +1926,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, double sc var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -1938,7 +1938,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -1949,7 +1949,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, double var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -1961,7 +1961,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -1972,7 +1972,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer colum var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -1984,7 +1984,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Pr var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -1995,7 +1995,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -2007,7 +2007,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primit var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -2018,7 +2018,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, doub var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -2030,7 +2030,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -2041,7 +2041,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, double var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -2285,7 +2285,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveCol var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -2296,7 +2296,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, float scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -2308,7 +2308,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -2319,7 +2319,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, float s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -2331,7 +2331,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -2342,7 +2342,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -2354,7 +2354,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Pri var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -2365,7 +2365,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, f var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -2377,7 +2377,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primiti var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -2388,7 +2388,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, float var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -2400,7 +2400,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -2411,7 +2411,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, float sc var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -2746,7 +2746,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColum var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -2757,7 +2757,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, int scalar, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -2769,7 +2769,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -2780,7 +2780,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, int scala var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -2792,7 +2792,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, Pr var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -2803,7 +2803,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -2815,7 +2815,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Primi var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -2826,7 +2826,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, int var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -2838,7 +2838,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -2849,7 +2849,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, int sca var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -2861,7 +2861,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveCol var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -2872,7 +2872,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, int scalar var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -3207,7 +3207,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColu var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -3218,7 +3218,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, long scalar var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -3230,7 +3230,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -3241,7 +3241,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, long sca var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -3253,7 +3253,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, P var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -3264,7 +3264,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -3276,7 +3276,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Prim var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -3287,7 +3287,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, lo var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -3299,7 +3299,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -3310,7 +3310,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, long s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -3322,7 +3322,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -3333,7 +3333,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, long scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -3668,7 +3668,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveCol var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -3679,7 +3679,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, sbyte scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -3691,7 +3691,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -3702,7 +3702,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, sbyte s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -3714,7 +3714,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -3725,7 +3725,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -3737,7 +3737,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Pri var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -3748,7 +3748,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -3760,7 +3760,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primiti var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -3771,7 +3771,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, sbyte var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -3783,7 +3783,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -3794,7 +3794,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, sbyte sc var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -4129,7 +4129,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveCol var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -4140,7 +4140,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, short scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -4152,7 +4152,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -4163,7 +4163,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, short s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -4175,7 +4175,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -4186,7 +4186,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -4198,7 +4198,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Pri var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -4209,7 +4209,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -4221,7 +4221,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primiti var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -4232,7 +4232,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, short var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -4244,7 +4244,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -4255,7 +4255,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, short sc var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -4590,7 +4590,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColu var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -4601,7 +4601,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, uint scalar var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -4613,7 +4613,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -4624,7 +4624,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, uint sca var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -4636,7 +4636,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, P var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -4647,7 +4647,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -4659,7 +4659,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Prim var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -4670,7 +4670,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, ui var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -4682,7 +4682,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -4693,7 +4693,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, uint s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -4705,7 +4705,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -4716,7 +4716,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, uint scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -5051,7 +5051,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveCol var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -5062,7 +5062,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, ulong scal var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -5074,7 +5074,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -5085,7 +5085,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, ulong s var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -5097,7 +5097,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -5108,7 +5108,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -5120,7 +5120,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Pri var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -5131,7 +5131,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, u var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -5143,7 +5143,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primiti var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -5154,7 +5154,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, ulong var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -5166,7 +5166,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveC var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -5177,7 +5177,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, ulong sc var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -5512,7 +5512,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveCo var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -5523,7 +5523,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, ushort sc var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -5535,7 +5535,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primitiv var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -5546,7 +5546,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, ushort var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } @@ -5558,7 +5558,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= otherSpan[i]); + ret[i + b] = (span[i] >= otherSpan[i]); } } } @@ -5569,7 +5569,7 @@ public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer colum var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] >= scalar); + ret[i + b] = (span[i] >= scalar); } } } @@ -5581,7 +5581,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, Pr var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= otherSpan[i]); + ret[i + b] = (span[i] <= otherSpan[i]); } } } @@ -5592,7 +5592,7 @@ public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] <= scalar); + ret[i + b] = (span[i] <= scalar); } } } @@ -5604,7 +5604,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer left, Primit var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > otherSpan[i]); + ret[i + b] = (span[i] > otherSpan[i]); } } } @@ -5615,7 +5615,7 @@ public void ElementwiseGreaterThan(PrimitiveColumnContainer column, usho var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] > scalar); + ret[i + b] = (span[i] > scalar); } } } @@ -5627,7 +5627,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < otherSpan[i]); + ret[i + b] = (span[i] < otherSpan[i]); } } } @@ -5638,7 +5638,7 @@ public void ElementwiseLessThan(PrimitiveColumnContainer column, ushort var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] < scalar); + ret[i + b] = (span[i] < scalar); } } } @@ -5757,7 +5757,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer left, Primitive var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == otherSpan[i]); + ret[i + b] = (span[i] == otherSpan[i]); } } } @@ -5768,7 +5768,7 @@ public void ElementwiseEquals(PrimitiveColumnContainer column, DateTim var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] == scalar); + ret[i + b] = (span[i] == scalar); } } } @@ -5780,7 +5780,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer left, Primit var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != otherSpan[i]); + ret[i + b] = (span[i] != otherSpan[i]); } } } @@ -5791,7 +5791,7 @@ public void ElementwiseNotEquals(PrimitiveColumnContainer column, Date var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i] = (span[i] != scalar); + ret[i + b] = (span[i] != scalar); } } } diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt index 4262d84c45..f77ecac1ed 100644 --- a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt @@ -79,9 +79,9 @@ namespace Microsoft.Data.Analysis <# } 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]); + ret[i + b] = (span[i] <#= method.Operator #> otherSpan[i]); <# } else if (method.MethodType == MethodType.ComparisonScalar) { #> - ret[i] = (span[i] <#= method.Operator #> <#= method.Op2Name #>); + ret[i + b] = (span[i] <#= method.Operator #> <#= method.Op2Name #>); <# } else {#> throw new NotImplementedException(); <# } #> From b85ea056241839ad06ce454d584e7ae2e187d9f0 Mon Sep 17 00:00:00 2001 From: Aleksei Smirnov Date: Tue, 6 Jun 2023 16:48:40 +0300 Subject: [PATCH 2/2] Fix --- .../PrimitiveDataFrameColumnArithmetic.cs | 456 ++++++++++++------ .../PrimitiveDataFrameColumnArithmetic.tt | 7 +- 2 files changed, 309 insertions(+), 154 deletions(-) diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs index 0747832533..0c8a0ec2ff 100644 --- a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.cs @@ -307,47 +307,51 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, bool scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } @@ -708,139 +712,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, byte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -1169,139 +1185,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, char scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -1539,139 +1567,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, decimal scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -1909,139 +1949,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, double scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -2279,139 +2331,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, float scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -2740,139 +2804,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, int scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -3201,139 +3277,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, long scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -3662,139 +3750,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, sbyte scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -4123,139 +4223,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, short scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -4584,139 +4696,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, uint scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -5045,139 +5169,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, ulong scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -5506,139 +5642,151 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= otherSpan[i]); + ret[index++] = (span[i] >= otherSpan[i]); } } } public void ElementwiseGreaterThanOrEqual(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] >= scalar); + ret[index++] = (span[i] >= scalar); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= otherSpan[i]); + ret[index++] = (span[i] <= otherSpan[i]); } } } public void ElementwiseLessThanOrEqual(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] <= scalar); + ret[index++] = (span[i] <= scalar); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > otherSpan[i]); + ret[index++] = (span[i] > otherSpan[i]); } } } public void ElementwiseGreaterThan(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] > scalar); + ret[index++] = (span[i] > scalar); } } } public void ElementwiseLessThan(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < otherSpan[i]); + ret[index++] = (span[i] < otherSpan[i]); } } } public void ElementwiseLessThan(PrimitiveColumnContainer column, ushort scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] < scalar); + ret[index++] = (span[i] < scalar); } } } @@ -5751,47 +5899,51 @@ public void RightShift(PrimitiveColumnContainer column, int value) } public void ElementwiseEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == otherSpan[i]); + ret[index++] = (span[i] == otherSpan[i]); } } } public void ElementwiseEquals(PrimitiveColumnContainer column, DateTime scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] == scalar); + ret[index++] = (span[i] == scalar); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer left, PrimitiveColumnContainer right, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < left.Buffers.Count; b++) { var span = left.Buffers[b].ReadOnlySpan; var otherSpan = right.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != otherSpan[i]); + ret[index++] = (span[i] != otherSpan[i]); } } } public void ElementwiseNotEquals(PrimitiveColumnContainer column, DateTime scalar, PrimitiveColumnContainer ret) { + long index = 0; for (int b = 0; b < column.Buffers.Count; b++) { var span = column.Buffers[b].ReadOnlySpan; for (int i = 0; i < span.Length; i++) { - ret[i + b] = (span[i] != scalar); + ret[index++] = (span[i] != scalar); } } } diff --git a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt index f77ecac1ed..a1543efd2d 100644 --- a/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt +++ b/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnArithmetic.tt @@ -58,6 +58,9 @@ namespace Microsoft.Data.Analysis <# if ((method.IsNumeric && !type.SupportsNumeric) || (method.IsBitwise && !type.SupportsBitwise) || (type.UnsupportedMethods.Contains(method.MethodName))) { #> throw new NotSupportedException(); <# } else if (method.Operator != null) { #> +<# if (method.MethodType == MethodType.Comparison || method.MethodType == MethodType.ComparisonScalar) { #> + long index = 0; +<# } #> for (int b = 0; b < <#= method.Op1Name #>.Buffers.Count; b++) { <# if (method.MethodType == MethodType.Comparison) { #> @@ -79,9 +82,9 @@ namespace Microsoft.Data.Analysis <# } else if (method.MethodType == MethodType.Binary) { #> span[i] = (<#=type.TypeName#>)(span[i] <#= method.Operator #> otherSpan[i]); <# } else if (method.MethodType == MethodType.Comparison) { #> - ret[i + b] = (span[i] <#= method.Operator #> otherSpan[i]); + ret[index++] = (span[i] <#= method.Operator #> otherSpan[i]); <# } else if (method.MethodType == MethodType.ComparisonScalar) { #> - ret[i + b] = (span[i] <#= method.Operator #> <#= method.Op2Name #>); + ret[index++] = (span[i] <#= method.Operator #> <#= method.Op2Name #>); <# } else {#> throw new NotImplementedException(); <# } #>