-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathVectorDataFrameFunctions.cs
More file actions
32 lines (27 loc) · 1.07 KB
/
VectorDataFrameFunctions.cs
File metadata and controls
32 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Microsoft.Data.Analysis;
namespace Tpch
{
internal static class VectorDataFrameFunctions
{
internal static DoubleDataFrameColumn ComputeTotal(DoubleDataFrameColumn price, DoubleDataFrameColumn discount, DoubleDataFrameColumn tax)
{
if ((price.Length != discount.Length) || (price.Length != tax.Length))
{
throw new ArgumentException("Arrays need to be the same length");
}
return price * (1 - discount) * (1 + tax);
}
internal static DoubleDataFrameColumn ComputeDiscountPrice(DoubleDataFrameColumn price, DoubleDataFrameColumn discount)
{
if (price.Length != discount.Length)
{
throw new ArgumentException("Arrays need to be the same length");
}
return price * (1 - discount);
}
}
}