series_dot_product_fl()series_dot_product_fl()
计算两个数值向量的点积。Calculates the dot product of two numerical vectors.
函数 series_dot_product_fl()
以包含两个动态数值阵列的表达式作为输入,并计算它们的点积。The function series_dot_product_fl()
takes an expression containing two dynamic numerical arrays as input and calculates their dot product.
备注
此函数是 UDF(用户定义的函数)。This function is a UDF (user-defined function). 有关详细信息,请参阅用法。For more information, see usage.
语法Syntax
series_dot_product_fl(
vec1,
vec2)
series_dot_product_fl(
vec1,
vec2)
参数Arguments
- vec1:数值的动态数组单元。vec1 : Dynamic array cell of numeric values.
- vec2:数值的动态数组单元,长度与 vec1 的长度相同。vec2 : Dynamic array cell of numeric values, same length as vec1.
使用情况Usage
series_dot_product_fl()
是用户定义的函数。series_dot_product_fl()
is a user-defined function. 可以在查询中嵌入其代码,或将其安装在数据库中。You can either embed its code in your query, or install it in your database. 用法选项有两种:临时使用和永久使用。There are two usage options: ad hoc and persistent usage. 有关示例,请参阅下面的选项卡。See the below tabs for examples.
如果是临时使用,请使用 let 语句嵌入其代码。For ad hoc usage, embed its code using a let statement. 不需要权限。No permission is required.
let series_dot_product_fl=(vec1:dynamic, vec2:dynamic)
{
let elem_prod = series_multiply(vec1, vec2);
let cum_sum = series_iir(elem_prod, dynamic([1]), dynamic([1,-1]));
todouble(cum_sum[-1])
};
//
union
(print 1 | project v1=range(1, 3, 1), v2=range(4, 6, 1)),
(print 1 | project v1=range(11, 13, 1), v2=range(14, 16, 1))
| extend v3=series_dot_product_fl(v1, v2)