|
10 | 10 |
|
11 | 11 | namespace Microsoft.Data.Analysis |
12 | 12 | { |
13 | | - internal class NumericDataFrameColumnArithmetic<T> : IPrimitiveDataFrameColumnArithmetic<T> |
14 | | - where T : unmanaged, INumber<T>, IShiftOperators<T, T>, IBitwiseOperators<T, T, T> |
| 13 | + internal class FloatingPointDataFrameColumnArithmetic<T> : IPrimitiveDataFrameColumnArithmetic<T> |
| 14 | + where T : unmanaged, INumber<T> |
15 | 15 | { |
16 | | - public NumericDataFrameColumnArithmetic() : base() |
| 16 | + public FloatingPointDataFrameColumnArithmetic() : base() |
17 | 17 | { |
18 | 18 | } |
19 | 19 | public void Add(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
@@ -231,162 +231,49 @@ public void Modulo(T scalar, PrimitiveColumnContainer<T> column) |
231 | 231 | } |
232 | 232 | } |
233 | 233 | } |
234 | | - public void And(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
| 234 | + public virtual void And(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
235 | 235 | { |
236 | | - for (int b = 0; b < left.Buffers.Count; b++) |
237 | | - { |
238 | | - var buffer = left.Buffers[b]; |
239 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
240 | | - left.Buffers[b] = mutableBuffer; |
241 | | - var span = mutableBuffer.Span; |
242 | | - var otherSpan = right.Buffers[b].ReadOnlySpan; |
243 | | - for (int i = 0; i < span.Length; i++) |
244 | | - { |
245 | | - span[i] = (T)(span[i] & otherSpan[i]); |
246 | | - } |
247 | | - } |
| 236 | + throw new NotSupportedException(); |
248 | 237 | } |
249 | | - public void And(PrimitiveColumnContainer<T> column, T scalar) |
| 238 | + public virtual void And(PrimitiveColumnContainer<T> column, T scalar) |
250 | 239 | { |
251 | | - for (int b = 0; b < column.Buffers.Count; b++) |
252 | | - { |
253 | | - var buffer = column.Buffers[b]; |
254 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
255 | | - column.Buffers[b] = mutableBuffer; |
256 | | - var span = mutableBuffer.Span; |
257 | | - for (int i = 0; i < span.Length; i++) |
258 | | - { |
259 | | - span[i] = (T)(span[i] & scalar); |
260 | | - } |
261 | | - } |
| 240 | + throw new NotSupportedException(); |
262 | 241 | } |
263 | | - public void And(T scalar, PrimitiveColumnContainer<T> column) |
| 242 | + public virtual void And(T scalar, PrimitiveColumnContainer<T> column) |
264 | 243 | { |
265 | | - for (int b = 0; b < column.Buffers.Count; b++) |
266 | | - { |
267 | | - var buffer = column.Buffers[b]; |
268 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
269 | | - column.Buffers[b] = mutableBuffer; |
270 | | - var span = mutableBuffer.Span; |
271 | | - for (int i = 0; i < span.Length; i++) |
272 | | - { |
273 | | - span[i] = (T)(scalar & span[i]); |
274 | | - } |
275 | | - } |
| 244 | + throw new NotSupportedException(); |
276 | 245 | } |
277 | | - public void Or(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
| 246 | + public virtual void Or(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
278 | 247 | { |
279 | | - for (int b = 0; b < left.Buffers.Count; b++) |
280 | | - { |
281 | | - var buffer = left.Buffers[b]; |
282 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
283 | | - left.Buffers[b] = mutableBuffer; |
284 | | - var span = mutableBuffer.Span; |
285 | | - var otherSpan = right.Buffers[b].ReadOnlySpan; |
286 | | - for (int i = 0; i < span.Length; i++) |
287 | | - { |
288 | | - span[i] = (T)(span[i] | otherSpan[i]); |
289 | | - } |
290 | | - } |
| 248 | + throw new NotSupportedException(); |
291 | 249 | } |
292 | | - public void Or(PrimitiveColumnContainer<T> column, T scalar) |
| 250 | + public virtual void Or(PrimitiveColumnContainer<T> column, T scalar) |
293 | 251 | { |
294 | | - for (int b = 0; b < column.Buffers.Count; b++) |
295 | | - { |
296 | | - var buffer = column.Buffers[b]; |
297 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
298 | | - column.Buffers[b] = mutableBuffer; |
299 | | - var span = mutableBuffer.Span; |
300 | | - for (int i = 0; i < span.Length; i++) |
301 | | - { |
302 | | - span[i] = (T)(span[i] | scalar); |
303 | | - } |
304 | | - } |
| 252 | + throw new NotSupportedException(); |
305 | 253 | } |
306 | | - public void Or(T scalar, PrimitiveColumnContainer<T> column) |
| 254 | + public virtual void Or(T scalar, PrimitiveColumnContainer<T> column) |
307 | 255 | { |
308 | | - for (int b = 0; b < column.Buffers.Count; b++) |
309 | | - { |
310 | | - var buffer = column.Buffers[b]; |
311 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
312 | | - column.Buffers[b] = mutableBuffer; |
313 | | - var span = mutableBuffer.Span; |
314 | | - for (int i = 0; i < span.Length; i++) |
315 | | - { |
316 | | - span[i] = (T)(scalar | span[i]); |
317 | | - } |
318 | | - } |
| 256 | + throw new NotSupportedException(); |
319 | 257 | } |
320 | | - public void Xor(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
| 258 | + public virtual void Xor(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right) |
321 | 259 | { |
322 | | - for (int b = 0; b < left.Buffers.Count; b++) |
323 | | - { |
324 | | - var buffer = left.Buffers[b]; |
325 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
326 | | - left.Buffers[b] = mutableBuffer; |
327 | | - var span = mutableBuffer.Span; |
328 | | - var otherSpan = right.Buffers[b].ReadOnlySpan; |
329 | | - for (int i = 0; i < span.Length; i++) |
330 | | - { |
331 | | - span[i] = (T)(span[i] ^ otherSpan[i]); |
332 | | - } |
333 | | - } |
| 260 | + throw new NotSupportedException(); |
334 | 261 | } |
335 | | - public void Xor(PrimitiveColumnContainer<T> column, T scalar) |
| 262 | + public virtual void Xor(PrimitiveColumnContainer<T> column, T scalar) |
336 | 263 | { |
337 | | - for (int b = 0; b < column.Buffers.Count; b++) |
338 | | - { |
339 | | - var buffer = column.Buffers[b]; |
340 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
341 | | - column.Buffers[b] = mutableBuffer; |
342 | | - var span = mutableBuffer.Span; |
343 | | - for (int i = 0; i < span.Length; i++) |
344 | | - { |
345 | | - span[i] = (T)(span[i] ^ scalar); |
346 | | - } |
347 | | - } |
| 264 | + throw new NotSupportedException(); |
348 | 265 | } |
349 | | - public void Xor(T scalar, PrimitiveColumnContainer<T> column) |
| 266 | + public virtual void Xor(T scalar, PrimitiveColumnContainer<T> column) |
350 | 267 | { |
351 | | - for (int b = 0; b < column.Buffers.Count; b++) |
352 | | - { |
353 | | - var buffer = column.Buffers[b]; |
354 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
355 | | - column.Buffers[b] = mutableBuffer; |
356 | | - var span = mutableBuffer.Span; |
357 | | - for (int i = 0; i < span.Length; i++) |
358 | | - { |
359 | | - span[i] = (T)(scalar ^ span[i]); |
360 | | - } |
361 | | - } |
| 268 | + throw new NotSupportedException(); |
362 | 269 | } |
363 | | - public void LeftShift(PrimitiveColumnContainer<T> column, int value) |
| 270 | + public virtual void LeftShift(PrimitiveColumnContainer<T> column, int value) |
364 | 271 | { |
365 | | - for (int b = 0; b < column.Buffers.Count; b++) |
366 | | - { |
367 | | - var buffer = column.Buffers[b]; |
368 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
369 | | - column.Buffers[b] = mutableBuffer; |
370 | | - var span = mutableBuffer.Span; |
371 | | - for (int i = 0; i < span.Length; i++) |
372 | | - { |
373 | | - span[i] = (T)(span[i] << value); |
374 | | - } |
375 | | - } |
| 272 | + throw new NotSupportedException(); |
376 | 273 | } |
377 | | - public void RightShift(PrimitiveColumnContainer<T> column, int value) |
| 274 | + public virtual void RightShift(PrimitiveColumnContainer<T> column, int value) |
378 | 275 | { |
379 | | - for (int b = 0; b < column.Buffers.Count; b++) |
380 | | - { |
381 | | - var buffer = column.Buffers[b]; |
382 | | - var mutableBuffer = DataFrameBuffer<T>.GetMutableBuffer(buffer); |
383 | | - column.Buffers[b] = mutableBuffer; |
384 | | - var span = mutableBuffer.Span; |
385 | | - for (int i = 0; i < span.Length; i++) |
386 | | - { |
387 | | - span[i] = (T)(span[i] >> value); |
388 | | - } |
389 | | - } |
| 276 | + throw new NotSupportedException(); |
390 | 277 | } |
391 | 278 | public void ElementwiseEquals(PrimitiveColumnContainer<T> left, PrimitiveColumnContainer<T> right, PrimitiveColumnContainer<bool> ret) |
392 | 279 | { |
|
0 commit comments